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 is 10n+2=7n+14
when lead nitrate reacts whith sodium iodide, sodium nitrate and lead iodide are formed if i start with 25.0 grams of lead nitrate and 15.0 grams of sodium iodi
could someone help me please ​
Which is an argument that people used against affirmative action? It would provide equal opportunities to all. It would remedy the legacy of racial discriminati
Given: k(O, r), AB = BC m∠B =120°, r=14cm Find: AB
Mis primos y yo__ mal. Siempre discutían conmigo y me hacían llorar a. Se llevaban b. Me llevaba c. Se llevaba d. Nos llevábamos
Simplify this expression using the distributive property. 8(9 + w) A. 72w B. 17 + 8w C. 72 + 8w D. 17w
Hi, help is very much appreciated! " Make a box-and-whisker plot of the data 5, 7, 2, 6, 7, 10, 12, 7, 9, 13, 5 "Maybe a visual explanation please :) ( I alread
How to work out the missing sides?
where do legislators work to make the laws​