Ask your own question, for FREE!
Computer Science 9 Online
OpenStudy (anonymous):

#include int main() { char c; scanf("%c",&c) printf("%c",c); return 0; } why iam not able to give a character to 'c' at runtime..

OpenStudy (harsimran_hs4):

Semicolon is missing at the end of the scanf statement , this would have been pointed out by the compiler Other than that everything is fine

OpenStudy (anonymous):

when you compile the code compile like this gcc -Wall -o name name.c -Wall means that if your program has wrongs thing like syntax errors those are to be mention at compile time ,if it so you can identify where went wrong ...

OpenStudy (rsmith6559):

With the addition of the semi-colon, your code works. Would this addition help: int main() { char c; printf( "Enter a character: " ); scanf("%c",&c); printf("%c\n",c); return 0; }

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!