Q. How many lines of output does the following C code produce?

Code:
#include<stdio.h> float i=2.0; float j=1.0; float sum = 0.0; main() { while (i/j > 0.001) { j+=j; sum=sum+(i/j); printf("%fn", sum); } } 
  • (A) 8
  • (B) 9
  • (C) 10
  • (D) 11
πŸ’¬ Discuss
βœ… Correct Answer: (D) 11

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
257
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
80%
Success Rate