What is the output of the following code?

int a = 3;
for (int i = 5; i > 0; i--)
{
a = a + i;
cout << a << “ “;
}

int a = 3;
for (int i = 5; i > 0; i--)
{
a = a + i;
cout << a << “ “;
}

int a = 3;
for (int i = 5; i > 0; i--)
{
a = a + i;
cout << a << “ “;
}

a) 7 10 12 13
b) 7 10 12 13 13
c) 8 12 15 17 18
d) 8 12 15 17 18 18

c) 8 12 15 17 18

Computer Science & Information Technology

You might also like to view...

Windows long file names can be up to __________ characters long.

a. 8 b. 255 c. 8 plus a 3-character extension d. an unlimited number of

Computer Science & Information Technology

Which of the following statements about formatted input is false?

A. scanf reads from stdin B. the parameter list includes data values to be read C. fscanf reads from user-specified stream D. input terminates when end-of-file is reached E. the conversion code specifies the type of data to be formatted

Computer Science & Information Technology