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
Is it possible to use curly brackets ({}) to enclose single line code in c program?
What is a pointer variable in c language?
What are the types of type qualifiers in c?
Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.
Difference between constant pointer and pointer to a constant.
What are runtime error?
What is static memory allocation?
What is gets() function?
Can a void pointer point to a function?
How many identifiers are there in c?
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
What is modifier & how many types of modifiers available in c?
Is c object oriented?
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
How does sizeof know array size?