You are on page 1of 5

4/11/2020

Online Quiz (1)

Question : 1

1-What is the output of this program?

#include

using namespace std;

int main()

int a;

a = 5 + 15/3 * 5;

cout << a;

return 0;

33

30

33.3

Question : 2
2-The value 132.54 can be represented using which data type?

double

void

int

bool

Question : 3

3- What is output of below program?

#include<iostream>

using namespace std;

int main()
1/5
4/11/2020

cout<<-1-1-1;

return 0;
}

Compilation Error

-3

Question : 4

4-What is output of below program?

int main()

int a=10;

int b,c;

b = a++;

c = a;

cout<<"a="<<a<<",b="<<b<<",c=<<c;

return 0;

a=11,b=10,c=11

a=11,b=11,c=11

a=10,b=10,c=11

a=10,b=10,c=10

Question : 5

5- Which operator has highest precedence?

+
2/5
4/11/2020

Question : 6

6- How many times CppBuzz.com is printed here?

int main()

for(int i=1; i< 5; i++) ;

cout<<"CppBuzz.com";

return 0;

Question : 7

7- What should be printed on screen?

int main()

int x = 5;

if(x++ == 5)

cout<<"Five"<<endl;

else

if(++x == 6)

cout<<"Six"<<endl;

return 0;

FiveSix

Five

Six

None of these

Question : 8
3/5
4/11/2020

8-Which of the following answers is the correct operator to compare


two variables

==

!=

All of the above

Question : 9

9- Find output of below program

int main()

int c1,c2;

int a = -8;

int b = 3;

c1 = --a + b;

c2 = a-- + b;

cout<<"c1="<<c1<<", "<<"c2="<<c2<<endl;

return 0;

c1=-7,c2=-4

c1=-7,c2=-3

c1=-4,c1=b-3

c1=-6,c2=-6

Question : 10

10- How many times 'its a while loop' should be printed?

int main()

int i , s=0,F=1 ;

for(i=1;i<5;i++)

{ F=F*i;
4/5
4/11/2020

s=s+F;

cout<<"s= "<<s;

return 0;

10

153

33

15

5/5

You might also like