Home Modern › Forums › ISRO › How many lines of output does the following C code produce? (A) 8 How many lines of output does the following C code produce? (A) 8#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
(
"%f\n"
, sum);
}
}
(B) 9
(C) 10
(D) 11#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
(
"%f\n"
, sum);
}
}
(B) 9
(C) 10
(D) 11
nan