in Others edited by
50 views
0 votes
0 votes

What is the effect of the following $\text{C}$ code?

for(int i=1 ; i ≤ 5 ; i = i + 1/2)
printf(" % d,", i);
  1. It prints $1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5$, and stops
  2. It prints $1, 2, 3, 4, 5$, and stops
  3. It prints $1, 2, 3, 4, 5$, and repeats forever
  4. It prints $1, 1, 1, 1, 1$, and repeats forever

     

in Others edited by
by
50 views

Please log in or register to answer this question.

Related questions