

MCQOPTIONS
Saved Bookmarks
1. |
In the program given below, point out the error, if any, in the while loop.
int main() { int k = 5; while ( ) { printf("%d n", k++); if (k >10) break; } return 0; } |
A. | There should be a condition in the while loop. |
B. | There should be at least a semicolon in the while( ). |
C. | The while loop should be replaced by a for loop. |
D. | No error |
Answer» B. There should be at least a semicolon in the while( ). | |