What will be the output of the following C code? int main() { int i, j, count; count=0; for (i=0; i<5; i++) { for(j=0; j<i; j++) { count++; } } printf("%d", count); return 0; }
- A.1
- B.5
- C.10
- D.25
Show answer
Answer: C. 10
Total executions of inner loop = 0 + 1 + 2 + 3 + 4 = 10.