Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1.If x starts out equal to 2, what value will be printed by the following code? if (x 3) x+=4; else x+=3; cout < <
1.If x starts out equal to 2, what value will be printed by the following code?
if (x <= 3) x+=2; if (x > 3) x+=4; else x+=3; cout << x << endl;
2.
What will the following code print out if count equals 3?
switch (count) { case 1: cout << "The "; break; case 2: cout << "cake "; break; case 3: cout << "is a "; default: cout << "lie."; }
3.
What will the following code print?
int count = 1; do { cout << count << endl; count += 1; }while(count >= 8);
4.
void func(int& val1, int val2) { int temp = val1; val1 = val2; val2 = temp; }
4.Given the function definition above, what will the following code print out?
int num1 = 4; int num2 = 17; func(num2, num1); cout << num1 << ", " << num2 << endl;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started