The point of this test was to see our knowledge of braces


You need some help understanding why the following code compiles the way it does. These were questions that you recently had on test.

The point of this test was to see our knowledge of "braces" locations within the code. So this code is missing braces.

1. What is the value after the following code executes?

int (donuts = 10;

if (donuts!= 10)

donuts = 0;

else

donuts += 2;

Answers:

A. 12

B. 10

C. 0

D. 2

2. What is the value of donuts after the following code executes?

int donuts = 10;

if (donuts = 1)

donuts = 0;

else

donuts +=2;

Answers:

A. 12

B. 10

C. 0

D. 1

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: The point of this test was to see our knowledge of braces
Reference No:- TGS02873569

Expected delivery within 24 Hours