What will be the output of the following C code? int main() { double k=0; for(k=0.0; k<3.0; k++) printf("muli"); return 0; }
- A.run time error
- B.muli is printed infinitely
- C.muli is printed twice
- D.muli is printed thrice
Show answer
Answer: D. muli is printed thrice
k iterates through 0.0, 1.0, and 2.0, printing "muli" three times.