c - #define and then printf not working -
for assignment must define variable n 100, recall variable in printf statement. code looks :
#include <stdio.h> #include <stdlib.h> #include <limits.h> #include <time.h> #define n 100 int main ( ) { ... printf("try guess number between 1 , n \n\n") ; ... }
the n
coming out n
rather 100
.
this because between double quotes considered character array, i.e. string. if want show n
in string, shall use "usual" variable:
printf("try guess number between 1 , %d \n\n", n) ;
Comments
Post a Comment