KRHS Internet Lesson

Teacher Name:Mr. Rung                          Date of Lesson: November

Course Name: C++                    Lesson Name: Chap 7.2c

Student Name

Password


Objective
Complete section 2 of chapter 7 in the workbook


Primary Focus
In the program below, each cout statement is numbered. Beside each of the numbered statements, indicate what output the statement will produce by selecting the correct answer.

Site Links

Additional Resources

Site Links


Question #1

#include &ltiostream.h>

int main ()

int b=5, i=8, j=0;

int Yes_No;


Yes_No=!(b<=i && b<=5);

cout << Yes_No << endl; //1


Question #2

#include &ltiostream.h>

int main ()

int b=5, i=8, j=0;

int Yes_No;

Yes_No=!Yes_No;
cout << Yes_No << endl; //2


Question #3

#include &ltiostream.h>

int main ()

int b=5, i=8, j=0;

int Yes_No;

Yes_No=( b < i && j < i );
if (Yes_No = = 1)

Yes_No=0;

cout << Yes_No << endl; //3


Question #4

#include &ltiostream.h>

int main ()

int b=5, i=8, j=0;

int Yes_No;

if(b>i && i>j)

Yes_No = 1;
cout << Yes_No << endl; //4


Question #5

#include &ltiostream.h>

int main ()

int b=5, i=8, j=0;

int Yes_No;

if (Yes_No>=O)
Yes_No = 1;
cout << Yes_No << endl; //5

return 0;

if(iNum >50 ||iNum < 75)
cout “Number is in range”;
else
cout “Number out of range”;

Output to the screen is ______________________________