Saturday, August 31, 2013

What is wrong in this C code?

What is wrong in this C code?

I am new to C and have just started to learn it so any help will be
appreciated
here is code i was trying to compile
#include <stdio.h>
int main(void)
{int n;
printf("Enter the value for the nuber to be tested\n");
scanf("%d, &n");
if
(n >= 1 <= 10)
printf("n is between 1 to 10\n");
}
So when i compile it and run it it print's the first statement to enter
the value of n. Then i enter the value, now here come the problem no
matter what value i enter output is always the same that "n is between 1
to 10". i am not able to figure out the problem please help
Thank's
user2735787

No comments:

Post a Comment