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 are types of preprocessor in c?
Can we declare variable anywhere in c?
Why void is used in c?
What does emoji p mean?
What does c value mean?
Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record
difference between native and cross compilers
What is pass by reference in c?
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?
Explain can static variables be declared in a header file?
Who is the main contributor in designing the c language after dennis ritchie?
What is the difference between abs() and fabs() functions?
What are the types of macro formats?
write a program to display all prime numbers
Explain what does it mean when a pointer is used in an if statement?