Access Millions of academic & study documents

Part 1

Content type
User Generated
Subject
Programming
Type
Homework
Showing Page:
1/2
Launch Visual Studio and create a new CH Win32 Console Application.
Lab 4aUsing Relational and Logical Operators Name: ______________________________
Step 1: Below is a copy of the source code lines that contain output statements. Remember that
arithmetic operations are done before relational operations and that relational operations
are done before logical operations. Recall also that if you output a Boolean variable or
the result of a Boolean expression, true displays as a 1 and false displays as a 0.
1 // Lab 4 tryIt4A
10 cout << ( 3 == 4) << endl;
11 cout << ( 3 == 3) << endl;
12 cout << ( 5 == 3 + 2) << endl << endl;
14 cout << (7 > 5) << endl;
15 cout << (7 > 5 + 2) << endl;
16 cout << (2 >= 8 % 3) << endl << endl;
18 cout << (8 < 6) << endl;
19 cout << (3 * 5 < 2 * 9 - 1) << endl;
20 cout << (5 * 4 <= 40 / 2) << endl << endl;
22 cout << (3 != 5) << endl;
23 cout << (3 != 9 - 2 * 3) << endl;
24 cout << (10 != (4 * 5) / 2) << endl << endl;
26 cout << (5 > 6 && 3 < 4) << endl;
27 cout << (5 > 6 || 3 < 4) << endl;
28 cout << (!(7 > 6)) << endl << endl;
30 cout << ( 2 * 3 == 6 && !(1 > 2) ) << en dl;
31 cout << ( !(2 * 3 == 6 && 1 > 2) ) << endl;
32 cout << ( !(2 * 3 == 6 && 1 != 2) ) << endl;
Expected Output
_____0_______
_____1_______
_____1_______
_____1_______
_____0_______
_____1_______
_____0_______
_____1_______
_____1_______
_____1_______
_____0_______
_____0_______
_____0_______
_____1_______
_____0_______
_____1_______
_____1_______
_____0_______
Observed Output
____0________
____1________
____1________
____1________
____0________
____1________
____0________
____1________
____1________
____1________
____0________
____0________
____0________
____1________
____0________
____1________
____1________
____0________

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/2

Sign up to view the full document!

lock_open Sign Up
Unformatted Attachment Preview
Launch Visual Studio and create a new CH Win32 Console Application. Lab 4a—Using Relational and Logical Operators Name: ______________________________ Step 1: Below is a copy of the source code lines that contain output statements. Remember that arithmetic operations are done before relational operations and that relational operations are done before logical operations. Recall also that if you output a Boolean variable or the result of a Boolean expression, true displays as a 1 and false displays as a 0. 1 // Lab 4 tryIt4A Expected Output Observed Output 10 cout ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4