void main()
{
char c;
while(c=getchar()!='\n')
printf("%d",c);
}
o/p=11 why?
Answer Posted / prashant
The answer would have been 11 only if the while statement would have had a semicolon to finish with , i.e. "while(c=getchar()!='\n');" According to the above code it will generate the ascii of all the characters entered except the newline character.
Regards
Prashant
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is the explanation for modular programming?
Explain the properties of union.
What are the three constants used in c?
What does it mean when the linker says that _end is undefined?
Why ca not I do something like this?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
How many types of operators are there in c?
When should volatile modifier be used?
Stimulate calculator using Switch-case-default statement for two numbers
What does the characters “r” and “w” mean when writing programs that will make use of files?
What is the difference between scanf and fscanf?
What are the 5 data types?
Explain what are global variables and explain how do you declare them?
What are the similarities between c and c++?
What is null pointer in c?