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
How can I change their mode to binary?
Can a program have two main functions?
What is variable in c example?
What is file in c preprocessor?
What are header files? What are their uses?
What is a macro, and explain how do you use it?
PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM
How many identifiers are there in c?
Is it better to use malloc() or calloc()?
Why c is called procedure oriented language?
Explain what standard functions are available to manipulate strings?
What is wrong in this statement? scanf(ā%dā,whatnumber);
Is javascript written in c?
What is the symbol indicated the c-preprocessor?
where are auto variables stored? What are the characteristics of an auto variable?