What does the following C program display on the screens Se

What does the following C ++ program display on the screens. See the code written below and choose the correct answer, (a) -111 -222 (b) 0 0 (c) 222 111 (d) 111 222

Solution

Since the picture that you uploaded is highly blurred, i will try to give you both scenarios from my understanding :

Question 15

Scenario 1:

assuming the for loop is running from 1 to 4 i.e for (i=1;i<4;i++)

The output of the code would be : 6

Scenario 2:

assuming the for loop is running from 1 to 8 i.e for (i=1;i<8;i++)

The output of the code would be : 28

Question 16

The answer to this question is b i.e 0 0

The code snippet being an example of function overloading in constructors. And it shows how two different function/constructors are called based on the parameters that are being passed.

 What does the following C ++ program display on the screens. See the code written below and choose the correct answer, (a) -111 -222 (b) 0 0 (c) 222 111 (d) 11

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site