Assume that a boolean variable named a has been declared


Assume that a boolean variable named a has been declared and assigned the value true or false. You should also assume that two hint variables named b and c have been declared and assigned some integer values.

a) If a is true, increment b by 1.

b) If a is true, increment b by 2; if a is false, decrement b by 1.

c) If a is true, change a to false, if a is false, change a to true.

d) If b is equal to c, then assign true to a.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Assume that a boolean variable named a has been declared
Reference No:- TGS01602691

Now Priced at $10 (50% Discount)

Recommended (99%)

Rated (4.3/5)