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
Write the Program to reverse a string using pointers.
will u please send me the placement papers to my mail???????????????????
What is static memory allocation? Explain
Explain is it valid to address one element beyond the end of an array?
What are the different types of endless loops?
What is a rvalue?
What is the difference between far and near ?
Who is the main contributor in designing the c language after dennis ritchie?
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
Is javascript written in c?
What is the difference between c and python?
Why we use void main in c?
What are register variables? What are the advantage of using register variables?
Is anything faster than c?
Write programs for String Reversal & Palindrome check