GAT Subject
Engineering
Computer Science Civil Engineering Chemical Engineering Agricultural Engineering Mechanical Engineering Electronics and Communication
4. | Point out the error, if any in the while loop? | |
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 with for loop. | |
D. | Error | |
Answer: Option A | |
Explanation: | |
The while() loop must have conditional expression or it shows "Expression syntax" error. Example: while(i > 10){ ... } |
|
Tutorial Link: |