How many times the following loop will be executed? for(; ;){ }Which of the following is true? a. The loop will execute exactly once b. The loop will not execute at all c. The loop will execute infinite times d. It will give a compile-time error
Question
How many times the following loop will be executed? for(; ;){ }Which of the following is true? a. The loop will execute exactly once b. The loop will not execute at all c. The loop will execute infinite times d. It will give a compile-time error
Solution
c. The loop will execute infinite times
Similar Questions
In the following program, how many times will the for loop execute?#include<stdio.h> int main() { int i=5; for(;scanf("%d", &i); printf("%d", i)); return 0; }Select one:The for loop will execute only onceThe for loop will execute infinite timesThe for loop will not execute at allThe for loop will execute 5 times
Which of the following for loops will be an infinite loop? for(; ;)for(i=0 ; i<1; i--) for(i=0; ; i++) All of the above
How many times following loop will be executed?void main(){ int i = 32766; while (i<= 32767) { printf("%d\n",i); i = i + 1; }}a.2 timesb.1 timesc.infinite timesd.loop will not be executed
Which of the following loops will execute the statements at least once, even though the condition is false initially?Question 10Answera.forb.whilec.do whiled.all of the above
Consider the program below: public static void main(String[] args) { int numThings = 0; for (int i = 0; i <= 10; i+=3) { numThings++; } } How many times does the body of the for loop run? Group of answer choices9010114
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.