blob5567 blob5567
  • 18-10-2019
  • Computers and Technology
contestada

What will the following code fragment print?

for (i = 0; i < 9; i++);

cout << i + 1;

cout << i;

Respuesta :

ExieFansler ExieFansler
  • 18-10-2019

Answer:

This code will print 109.

Explanation:

Condition is the integer i is declared before the loop then the code will print 109. 10 because of the statement cout<<i+1; and 9 because of the cout<<i; . The for loop starts with 0 and ends when the value of i becomes 9. Since there is semi-colon after the for loop so the next statement after the for loop is not included in the loop.

Answer Link

Otras preguntas

What jobs did English immigrants have
plz help ASAP!!!!!!!!!!!
Opposite vertices of a rectangular box whose edges are parallel to the coordinate axes are (-5, -6, 3) and (-9, 10, 4) . List the coordinates of the other six v
*Why were they an important founding Fathers? *One reason for each* George Washington James Madison Benjamin Franklin George Mason Alexander Hamilton
why would an author use hyperbole?​
Find cos(20°)+2cos^2 (80°)help me pls.​
Roy buys a coat for $86.40, which includes an 8% sales tax. Which equation could you use to find the cost of the coat, c, without the sales tax?
which of the following is/are characteristics of the earth but not the moon?
in 20 years charles will bevthree time as old as he is now. how old is he now?
The linear equation 3x-4y=8 is written in_______. A. Quadratic form B. Point-slop form C. Slope-intercept form D. Standard form