Question 38

How many lines of output does the following C code produce?
#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);
}
}


Create a FREE account and get:

  • Download Maths Shortcuts PDF
  • Get 300+ previous papers with solutions PDF
  • 500+ Online Tests for Free

cracku

Boost your Prep!

Download App