Given the integer variables yearswithcompany and department


1 Given two int variables, i and j , which have been declared and initialized, and two other int variables, itemp and jtemp , which have been declared, write some code that swaps the values in i and j by copying their values to itemp and jtemp , respectively, and then copying itemp and jtemp to j and i , respectively.

2. Given three already declared int variables, i , j , and temp , write some code that swaps the values in i and j . Use temp to hold the value of i and then assign j 's value to i . The original value of i , which was saved in temp , can now be assigned to j.

3. Given three already declared int variables, i , j , and temp , write some code that swaps the values in i and j . Use temp to hold the value of i and then assign j 's value to i . The original value of i , which was saved in temp , can now be assigned to j .

4. Write a statement that toggles the value of onOffSwitch . That is, if onOffSwitch is false, its value is changed to true; if onOffSwitch is true, its value is changed to false.

5. Given the integer variables yearsWithCompany and department , write an expression that evaluates to true if yearsWithCompany is less than 5 and department is not equal to 99 .

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Given the integer variables yearswithcompany and department
Reference No:- TGS01248247

Now Priced at $20 (50% Discount)

Recommended (95%)

Rated (4.7/5)