Page 58 - Modular_V2.0_C++_Flikpbook
P. 58
Periodic Assessment-2
(Based on chapters 3 to 5)
A. Write the use of following operators with an example:
1. != operator
...............................................................................................................................................................................................
...............................................................................................................................................................................................
2. && operator
...............................................................................................................................................................................................
...............................................................................................................................................................................................
3. %= operator
...............................................................................................................................................................................................
...............................................................................................................................................................................................
4. ++ operator
...............................................................................................................................................................................................
...............................................................................................................................................................................................
B. Write the output of the following program:
#include<iostream.h>
void main()
{
int time = 08;
if(time < 12)
{
cout>>"Good morning.";
}
else if(time > 20)
{
cout<<"Good night.";
}
else
{
cout<<"Good evening.";
}
}
C. Write a C++ program to solve the following expression:
A + 3 * (B - 4) - 10/2
Where, A = 25 and B = 10.
56
Touchpad MODULAR (Ver. 2.0)

