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

How were citizens of Rome involved in the political process?
Simplify each expression. If not possible, write simplified. 1. 12a - a 2. 3x + 6x 3. 3x - 1
explain how Fundamentalist Americans resisted the trends of the 1920s and advocated returning to more traditional ways
What was Tocqueville’s concern with individualism in America?
How many milliliters of C5H12 are needed to make 97.3 ml C5H8? density of C5H12 = 0.620 g/mL density of C5H8 = 0.681 g/mL density of H2= 0.0899g/L Please explai
Which explains how the Sierra Nevada Mountains of California cause the southwestern United States to have a desert climate? A. The mountains reflect excess heat
how should you read this passage to answer a general question?
What was Tocqueville’s concern with individualism in America?
the length of a classroom is 34 feet what is this measurement in yards and feet
if t(n) = 6n+2 what is the 3rd term