C Programming - Control Instructions - Discussion
Discussion Forum : Control Instructions - Point Out Correct Statements (Q.No. 9)
9.
Point out the correct statements are correct about the program below?
#include<stdio.h>
int main()
{
char ch;
while(x=0;x<=255;x++)
printf("ASCII value of %d character %c\n", x, x);
return 0;
}
Answer: Option
Explanation:
There are 2 errors in this program.
1. "Undefined symbol x" error. Here x is not defined in the program.
2. Here while() statement syntax error.
Discussion:
12 comments Page 2 of 2.
Vinoth said:
1 decade ago
Khan you understand in while loop only condition is checked.
Eg:while(x>5).
Eg:while(x>5).
Abid khan said:
1 decade ago
While statement work properly.
But x is not declared so while statement missing.
But x is not declared so while statement missing.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers