void main()
{
char c;
while(c=getchar()!='\n')
printf("%d",c);
}
o/p=11 why?
Answer Posted / sumeet saini
It says %d which means it prints integer value. If we want to print character we need to write %c. So the answer is right. If we replace %d with %c . This program will print what ever character we hit from keyboard until we press enter
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Explain what does the format %10.2 mean when included in a printf statement?
Why is c called "mother" language?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
How do you generate random numbers in C?
What happens if header file is included twice?
Explain the binary height balanced tree?
Tell me about low level programming languages.
How can I open a file so that other programs can update it at the same time?
Explain what is the difference between functions getch() and getche()?
What is the description for syntax errors?
What do you mean by dynamic memory allocation in c? What functions are used?
Is c programming hard?
What are reserved words with a programming language?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
When should a far pointer be used?