-
In the program given below, point out the error, if any, in the while loop.
#include <studio.h>
int main()
{
int k = 5;
while ( )
{
printf("%d\n", k++);
if (k >10)
break;
}
return 0;
}
-
- There should be a condition in the while loop.
- There should be at least a semicolon in the while( ).
- The while loop should be replaced by a for loop.
- No error
Correct Option: A
The while() loop must have a conditional expression or it shows "Expression syntax" error.