Quiz 2 Solution

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

GHULAM ISHAQ KHAN INSTITUTE OF ENGINEERING SCIENCES AND TECHNOLOGY

Materials Engineering Manufacturing (MTM)


F Introduction to Computing and Programming (CS101) (Fall 2021)

Name __________________ Reg No.______________ Marks (10)


Quiz # 2 Semester (1st) Date: 11-Nov-2021 Time allotted: 10 Mins

Q1. Write down Output of following set of Codes. Assume all relevant header files have been included.

int main(){
int number = 4;
double alpha = -1.0;
if (number > 0)
if (alpha > 0)
cout<<"Here I am!"<<endl;
else
cout<<"No, I am here!"<<endl;
cout<<"No, actually, I am here!"<<endl;

Output here:

No, I am here!
No, actually, I am here!

int main(){
int x=0, i=10;
while(i < 0)
{ x++; }
cout<<x;
return 0; }

Output here:

~~~~~~~~~~~~~~~~~~~~~~ There are no shortcuts to success ~~~~~~~~~~~~~~~~~~~~~

You might also like