# C++ Outputs For CBSE STD-xii

6 Questions | Total Attempts: 198

Settings

This Quiz helps the CBSE computer science students of STD XII to develop the logical thinking skills of various concepts in C++.

• 1.
Find the output :-void main(){  int k[ ] = {100,200,300,400,500,600,700};  int *t=k+2;    cout<<*t;  cout<<"\n"<<*(t+2) + *t;  *t = *t + 10;   cout<<*t;   t=t+3;   cout<<*t   *t = *t + *(t-2);    cout<<*t;  }
• A.

300 900 320 600 1000

• B.

300 800 310 600 1000

• C.

100 900 310 600 1000

• D.

300 800 310 600 900

• E.

None of the above

• 2.
Find the output:-int p[ ] = {50,60,70,80,90,100};int *q[ ];for(int i =0;i<6;i++){  q[i] = &p[i];}for(int i=5;i>=1;i--){  q[i] =  q[i-1];  *q[i] = *q[i] + *p * 2; }for(int i=0;i<6;i++){ cout<<"\n "<<p[i];
• A.

160 160 170 180 190 100

• B.

150 150 150 150 150 150

• C.

150 160 170 180 190 190

• D.

150 160 170 180 190 200

• E.

150 160 170 180 190 100

• 3.
#include#include#includevoid main(){clrscr();  char *S="OnLine Test1iN2g";  char *t=S;  cout<<*(t+5)<<"\n";  t=t+2;  *t=*t+1;  cout.write(t,5);cout<<"\n";  cout<
• A.

E Mine OnMine Test1iN2g nniine/eesT1i22g

• B.

N Line OnMine Test1iN2g nniine/eesT1i22g

• C.

E Mine OnMine/Test1iN2g nniine/eesT1i22g

• D.

E Mine OnMine Test1iN2g mniine/eesT1i22g

• E.

None of the above

• 4.
Find the output of the following program:                                                                                             [2]                                 #include                                 #include                                 #include                                 struct KEY                                                                 {                                                                                 char word[10];                                                                                 int count;                                                                 };                                 void changekeyword(KEY somekey);                                          void main()                                 {                                                 KEY aKEY;                                                 strcpy(aKEY.word, “#define”);                                                 aKEY.count=0;                                                 changekeyword(aKEY);                                                 cout<<"\n"<<aKEY.word<<"\t"<<aKEY.count;
• A.

Const 0 define 1

• B.

Define 0 const 1

• C.

Const 1 define 0

• D.

Const 10 define 0

• E.

Const 1 define 10

• 5.
Find the output of the following program : #include #include class state { char *state_name; int size; public: state( ); { size=0; state_name=new char[size+1]; } state(char *s) { size = strlen(s) ; state_name = new char[size+1]; strcpy(state_name,s); } void display( ) {cout<
• A.

DelhiMumbai DelhiMumbaiNagpur

• B.

Delhi Mumbai Delhi Mumbai Nagpur

• C.

DelhiMumbaiNagpur DelhiMumbai

• D.

MumbaiDelhi DelhiMumbaiNagpur

• E.

DelhiMumbai NagpurDelhiMumbai

• 6.
Find the output of the following program : #include void main( ) { long NUM= 1234543; int F=0, S=0; do { int Rem = NUM% 10 ; if (Rem % 2 !=0) F+=Rem; else S+=Rem; NUM /=10; }while(NUM>0); cout<F+S;
• A.

22

• B.

1

• C.

3

• D.

0

• E.

2

Related Topics