Recent questions tagged loop

0 votes
1 answer
1
How many times is the comparison $i >= n$ performed in the following program?int i = 200 n = 80; main() { while (i >= n) { i = i - 2 n = n + 1 } }
0 votes
1 answer
4
can anyone explain how the for loop works here..?
0 votes
2 answers
7
What will be the output printed for find(4)? void find(int x) { static int i = 10, y = 0; y = y + i; for(i; i>0; i = i - 10) { if(x! = 0) find(x – 1); else printf(“%d...
6 votes
4 answers
9
3 votes
3 answers
10
for(int i=0; i<=100;i++) { if (i % 3 == 0) printf("Great); if(i%5 == 0) printf("India"); }Count the number of times GreatIndia is printed.62033none of these
1 votes
0 answers
11
i have 1 doubt regarding the initialization of highlighted portion.Will the value of ’k’ change at each iteration or it will remain same (whatever value assigned to i...
0 votes
0 answers
13
#include <stdio.h>int main(){ int i = 0; do { printf("Hello "); i = i++; } while (i < 5); return 0;}why this prints Hello infinitely?shoul...
4 votes
1 answer
16
for(i=0;i<=n;i++){ for(j=0;j<=i2;j++){ for(k=0;k<=$\frac{n}{2}$;k++){ x=y+z;}}}How many times the x=y+z statement will execute?
8 votes
5 answers
18
What will be the output of the following C code?#include <stdio.h main() { int i; for(i=0;i<5;i++) { int i=10; printf("%d" , i); i++; } return 0; }10 11 12 13 1410 10 10 ...
0 votes
3 answers
19