xii cbse previous year question paper question no 1 (e) 2 or 3 marks

50
XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

Upload: jacob-pearson

Post on 16-Jan-2016

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

XII CBSE Previous Year Question

Paper

QUESTION NO 1 (E)

2 or 3 Marks

Page 2: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

1 (e) Find the output of the following program : Delhi 2006 2

#include<iostream.h>void main( ){ long NUM= 1234543;int F=0, S=0;do{ int Rem = NUM% 10 ;if (Rem % 2 !=0)F+=R;elseS+=R;NUM /=10;}while(NUM>0);cout<<F-S;}

Page 3: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

Ans: (e)

2 (assuming R as Rem)

(2 marks for correct output as 2)OR(2 marks for identifying error as R is not declared)OR(Full 2 marks to be awarded to the students who have scored at least1 mark in the entire Q. No. 1 i.e. from 1(a) to 1(f))

Page 4: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

2 (e) Find the output of the following program : OD 2006 2

#include<iostream.h>void main(){ long Number = 7583241;int First=0, Second=0;do{ int R = Number%10;if(R%2==0)First+=R;elseSecond+=R;Number /=10;}while(Number>0);cout<<First-Second;}

Page 5: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

(e) -2

(Full 2 marks for correct output)OR

(Full 2 marks for mentioning values of First as 14 and Second as 16, as representation of minus sign is not very prominent)

OR(Full 2 marks for mentioning syntax error with justification as insertion operator << expected in between First and Second)

Page 6: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

3 (e) Find the output of the following program :Delhi 2007 3

#include<iostream.h>void Indirect(int Temp=20){for (int 1=10; I<=Temp; I+=5)cout<<I<<” , “ ;cout<<endl;}void Direct (int &Num){Num+=10;Indirect(Num);}

Page 7: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

3 (e) Find the output of the following program :Delhi 2007 3

void main(){int Number=20;Direct(Number) ;Indirect();cout<< “ Number=” <<Number<<endl ;}

Page 8: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

(e) 10, 15, 20, 25, 30,10, 15, 20,Number=30

(1 Mark for each correct line of output)Note:· ½ Mark to be deducted for missing Commas (,) in each line of output· ½ Mark to be deducted if endl is not considered in the output

Page 9: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

4 (e) Find the output of the following program : OD 2007 3

# include < iostream.h>void Withdef (int HisNum = 30){for (int 1=20 ; I<*= HisNum; I+=5)cout<<I<<””;cout<<endl;}void Control (int &MyNum){MyNum+=10;Withdef(MyNum);}

Page 10: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

4 (e) Find the output of the following program : OD 2007 3

void main (){int YourNum=20;Control (YourNum);Withdef();cout<<”Number=”<<YourNum<<endl;}

Page 11: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

(e) 20,25,30,20,25,30,Number=30

(1 Mark for each correct line of output)Note:· ½ Mark to be deducted for missing Commas (,) in the output· ½ Mark to be deducted if endl is not considered in the output

Page 12: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

5 (e) Find the output of the following program: Delhi 2008 2

#include<iostream.h>void main ( ){int U = 10, V = 20;for (int I = 1; 1 < = 2; 1++){cout<<“[1]=”<<U++<<“&”<<V–5<<endl;cout<<“[2]=”<<++V<<“&”< <U+ 2< <endl;}}

Page 13: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

Ans: Nnd@*Xrk!*

(½ Mark for N in the 1st position)(½ Mark for nd in the 2nd and 3rd position)(½ Mark for @ in the 4th position)(½ Mark for * in the 5th position)(½ Mark for Xrk!)(½ Mark for * at the end)OR(Fu1l 3 Marks If error is mentioned in the code for Text (I) after last else)

Page 14: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

6 (e) Find the output of the following program : OD 2008 2

#include<iostream.h>void main ( ){int A=5, B=10;for (int I = 1; I<=2; 1++){cout<< “Linel=”<<A++<<“&”<<B–2<<endl;cout<<“Line2=”<<++B<<“&”<<A+3<<endl;}}

Page 15: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

Ans:Line1=5&8Line2=11&9Line1=6&9Line2=12&10

(½ Mark for each correct line of output)Note: . ½ Mark to be deducted for missing Ampersand (&) in each line of output ½ Mark to be deducted if endl is not considered in the output

Page 16: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

7 (e) Find the output of the following program : Delhi 2009 2#include<iostream.h>#include<ctype.h>void Encode (char Info [ ], int N) ;void main ( ){char Memo [ ] = “Justnow” ;Encode(Memo, 2) ;cout<<Memo<<endl ;}

Page 17: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

7 (e) Find the output of the following program : Delhi 2009 2

void Encode(char Info[ ], int N){for (int I = 0 ; Info[I] != ‘\0’ ; 1++)if (1%2= =0)Info[I] = Info[I] –N ;else if (islower(Info[I]))Info[I] = toupper(Info[I]) ;elseInfo[I] = Info[I] +N ;}

Page 18: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

Ans HuqTlOu

(½ Mark for writing H, U as the first two characters)(½ Mark for writing q, T as the next two characters)(½ Mark for writing 1, O as the next two characters)(½ Mark for writing u as the last character)

Page 19: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

8 (e) Find the output of the following program: OD 2009 2

#include <iostream.h>#include <ctype.h>void Secret (char Mig [ ], int N);void main ( ){char SMS[ ] = “rEPorTmE” ;Secret{SMS,2);cout<<SMS<<end1;}

Page 20: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

8 (e) Find the output of the following program: OD 2009 2

void Secret(char Msg[ ], int N){for (int C=0; Msg[C] ! =’ \0' ;C++)if (C%2==0)Msg[C] = Msg[C]+N;else if (isupper(Msg[C]))Msg[C] = tolower(Msg[C]);elseMsg[C] = Msg[C]-N;}

Page 21: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

Ans teRmttoe

(½ Mark for writing t,e as the first two characters)(½ Mark for writing R,m as the next two characters)(½ Mark for writing t,t as the next two characters)(½ Mark for writing o,e as the next two characters)

Page 22: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

9 (e) Find the output of the following program : Delhi 2010 2

#include <iostream.h>#include <ctype.h>void ChangeIt(char Text[ ], char C){for (int K=0;Text[K]!='\0';K++){if (Text[K]>=’F’ && Text[K]<=’L’)Text[K]=tolower(Text[K]);elseif (Text[K]=’E’ || Text[K]==’e’)Text[K]= =C;

Page 23: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

9 (e) Find the output of the following program : Delhi 2010 2

elseif (K%2==O)Text[K]=toupper(Text[K]);elseText[K]=Text[K-l];}}

Page 24: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

9 (e) Find the output of the following program : Delhi 2010 2

void main ( ){char OldText[ ]=”pOwERALone”;ChangeIt(OldText,’%’);cout<<“New TEXT:”<<OldText<<endl;}

Page 25: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

Ans. 16, 24, 66, 34, 1618, 22, 28

(1 Mark for each line with -correct values)OR(½ Mark for any two correct values in each line)Note:Deduct (½ Mark if any/all ‘,’ missingDeduct (½ Mark if endl is not considered at the right positions

Page 26: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

10 (e) Find the output of the following program: OD 2010 2

#include <iostream.h>#include <ctype.h>void MyCode (char Msg [], char CH){for (int (Cnt=O;Msg[Cnt]!=’\0';Cnt++){if (Msg[Cnt]>=’B’ && Msg[Cnt]<=’G’)Msg[Cnt]=tolower(Msg[Cnt]);elseif (Msg[Cnt]==’A’|| Msg[Cnt]==’a’)Msg[Cnt]=CH;

Page 27: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

10 (e) Find the output of the following program: OD 2010 2

elseif (Cnt%2==0)Msg[Cnt]=toupper(Msg[Cnt]);elseMsg[Cnt]=Msg[Cnt-l];}}void main (){char MyText [] =” ApEACeDriVE”;MyCode(MyText,’@’);cout<<“NEW TEXT:”<<MyText<<endl;}

Page 28: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

Ans.

NEW TEXT :@@e@ccddIIe

(½ Mark for writing @,@,e as the first three characters)(½ Mark for writing @,c,c as the next three characters)(½ Mark for writing d,d, I as the next three characters)(½ Mark for writing I,e as the next two characters)Note:Deduct ½ Mark for not mentioning NEW TEXT:

Page 29: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

11 (e) Find the output of the following program: Delhi 2011 2

#include<iostream.h>void main ( ){int Track [ ] = {10, 20, 30, 40}, *Striker ;Stxiker=Track :Track [1] += 30 ;cout<<"Striker>"<<*Striker<<end1 ;Striker – =10 ;Striker++ ;cout<<"Next@"<<*Striker<<end1 ;Striker+=2 ;cout<<"Last@"<<*Striker<<end1 ;cout<< "Reset To" <<Track[0] <<end1 ;}

Page 30: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

Ans Striker>10Next@50Last@40Reset to 0

(½ for writing each line of output correctly)Note:Deduct ½ Mark if any/all special characters are missingDeduct ½ Mark if endl is not considered at the right positions

Page 31: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

12 (e) Find the output of the following program:OD 2011 2

#include<iostream.h>void main ( ){int *Queen, Moves [ ] = {11, 22, 33, 44};Queen = Moves;Moves [2] + = 22;cout<< "Queen @"<<*Queen<<end1;*Queen - = 11;Queen + = 2;cout<< "Now @"<<*Queen<<end1;Queen++;cout<< "Finally@"<<*Queen«end1;cout<< "New Origin @"<<Moves[0]<<end1;}

Page 32: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

Ans Queen @11Now @55Finally @44New origin @0

(½ Mark for writing each line of output correctly)Note:Deduct ½ Mark if any/all '@' missing or/and endl is not considered at the right positions

Page 33: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

13 (e) Find the output of the following program:

SAMPLE PAPER 2009 SET I 2#include <iostream.h>#include <ctype.h>void Encrypt(char T[]){

for (int i=0;T[i]!='\0';i+=2)if (T[i]=='A' || T[i]=='E') T[i]='#';

else if (islower(T[i])) T[i]=toupper(T[i]);else T[i]='@';}

Page 34: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

13 (e) Find the output of the following program:

SAMPLE PAPER 2009 SET I 2void main()

{char Text[]="SaVE EArtH";//The

two words in the string Text//are separated by single space

Encrypt(Text);cout<<Text<<endl;

}

Page 35: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

Answer:@a@E@E#rTH

(1 Mark for writing all alphabets at correct positions)(1/2 Mark for writing @ at correct

positions) (1/2 Mark for writing # at correct

position)

Page 36: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

14 (e) Find the output of the following program:

SAMPLE PAPER 2009 SET II 2#include <iostream.h>struct Game{

char Magic[20];int Score;};void main(){

Game M={“Tiger”,500};char *Choice;

Page 37: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

14 (e) Find the output of the following program:

SAMPLE PAPER 2009 SET II 2Choice=M.Magic;Choice[4]=’P’;Choice[2]=’L’;M.Score+=50;cout<<M.Magic<<M.Score<<endl;Game N=M;N.Magic[0]=’A’;N.Magic[3]=’J’;N.Score-=120;cout<<N.Magic<<N.Score<<endl;

}

Page 38: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

Answer:TiLeP550AiLJP430

(1 Mark for each line of output)

Page 39: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

15 (e) Find the output of the following program: SAMPLE PAPER 2010 SET I 2

#include <iostream.h>void Secret(char Str[ ]){for (int L=0;Str[L]!='\0';L++);for (int C=0;C<L/2;C++)if (Str[C]=='A' || Str[C]=='E')Str[C]='#';else{char Temp=Str[C];

Page 40: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

15 (e) Find the output of the following program: SAMPLE PAPER 2010 SET I 2

Str[C]=Str[L-C-1];Str[L-C-1]=Temp;}}void main(){char Message[ ]="ArabSagar";Secret(Message);cout<<Message<<endl;}

Page 41: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

ANS: #agaSbarr

(2 Marks for correct line of output)

Page 42: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

16 (e) Find the output of the following program: SAMPLE PAPER 2010 SET II 2#include <iostream.h>struct Game{char Magic[20];int Score;};void main(){Game M={"Tiger",500};char *Choice;

Page 43: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

16 (e) Find the output of the following program: SAMPLE PAPER 2010 SET II 2Choice=M.Magic;Choice[4]='P';Choice[2]='L';M.Score+=50;cout<<M.Magic<<M.Score<<endl;Game N=M;N.Magic[0]='A';N.Magic[3]='J';N.Score-=120;cout<<N.Magic<<N.Score<<endl;}

Page 44: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

ANS:TiLeP550AiLJP430

(1 Mark for each line of output)

Page 45: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

17 SAMPLE PAPER 2012 SET I

Page 46: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

17 SAMPLE PAPER 2012 SET I

Page 47: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

17 SAMPLE PAPER 2012 SET I

Page 48: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

18 SAMPLE PAPER 2012 SET II

Page 49: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

18 SAMPLE PAPER 2012 SET II

Page 50: XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks

THANK YOU