Fop If Else
Fop If Else
cout<< "Enter number of hours = "; //It will display a message to give hours
cout<<" This is an overload "; //It will show a message that it is an overload
}
Muhammad Tayyab Gulzar Page 1
Introduction to Computer Programming (EE)
Question no 2
2. If classification is equal to 5 then set the character variable Type equal to 'G',
and print a message saying "graduate student"; otherwise set Type equal to 'U'
and print a message saying "undergraduate".
string Type;
If classification is equal to 5
Question no 3
If x is 10 then
Question no 4
1. After execution of the following code, what will be the value of x?
x = 30;
y = 20;
if (y != (x - 10))
x = x - 5;
else
x = y;
#include<iostream> //It is preprocessor directive
x = y; //Then x=y
cout<<"Value of x = "<<x; //It will print value of x and show its value
Question no 5
cout<<"Enter temperature in Celcius :"; //It will display statement in inverted commas
cout<<"Enter temperature in Farenheit :"; //It will display statement in inverted commas
cout<<"It is hot day "; //It will display statement in inverted commas
else if (((c> 20) && (c<22)) || ((f>25) && (f<27))) //Multiple condition
g. If temp in F is less than 28, display “it is cold day” regardless of the
value of C.
Question 6
getch();
If x is an integer
If we put a character