SlideShare a Scribd company logo
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;
else
S+=R;
NUM /=10;
}while(NUM>0);
cout<<F-S;
}
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 least
1 mark in the entire Q. No. 1 i.e. from 1(a) to 1(f))
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;
else
Second+=R;
Number /=10;
}while(Number>0);
cout<<First-Second;
}
(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)
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);
}
3 (e) Find the output of the following program :
Delhi 2007 3
void main()
{
int Number=20;
Direct(Number) ;
Indirect();
cout<< “ Number=” <<Number<<endl ;
}
(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
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);
}
4 (e) Find the output of the following program :
OD 2007 3
void main ()
{
int YourNum=20;
Control (YourNum);
Withdef();
cout<<”Number=”<<YourNum<<endl;
}
(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
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;
}
}
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)
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;
}
}
Ans:
Line1=5&8
Line2=11&9
Line1=6&9
Line2=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
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 ;
}
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]) ;
else
Info[I] = Info[I] +N ;
}
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)
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;
}
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]);
else
Msg[C] = Msg[C]-N;
}
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)
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]);
else
if (Text[K]=’E’ || Text[K]==’e’)
Text[K]= =C;
9 (e) Find the output of the following program :
Delhi 2010 2
else
if (K%2==O)
Text[K]=toupper(Text[K]);
else
Text[K]=Text[K-l];
}
}
9 (e) Find the output of the following program :
Delhi 2010 2
void main ( )
{
char OldText[ ]=”pOwERALone”;
ChangeIt(OldText,’%’);
cout<<“New TEXT:”<<OldText<<endl;
}
Ans.
16, 24, 6
6, 34, 16
18, 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 ‘,’ missing
Deduct (½ Mark if endl is not considered at the right
positions
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]);
else
if (Msg[Cnt]==’A’|| Msg[Cnt]==’a’)
Msg[Cnt]=CH;
10 (e) Find the output of the following program:
OD 2010 2
else
if (Cnt%2==0)
Msg[Cnt]=toupper(Msg[Cnt]);
else
Msg[Cnt]=Msg[Cnt-l];
}
}
void main ()
{
char MyText [] =” ApEACeDriVE”;
MyCode(MyText,’@’);
cout<<“NEW TEXT:”<<MyText<<endl;
}
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:
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 ;
}
Ans
Striker>10
Next@50
Last@40
Reset to 0
(½ for writing each line of output correctly)
Note:
Deduct ½ Mark if any/all special characters are
missing
Deduct ½ Mark if endl is not considered at the
right positions
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;
}
Ans
Queen @11
Now @55
Finally @44
New 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
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]='@';
}
13 (e) Find the output of the following
program:
SAMPLE PAPER 2009 SET I 2
void main()
{
char Text[]="SaVE EArtH";//The
two words in the string Text
//are separated by single space
Encrypt(Text);
cout<<Text<<endl;
}
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)
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;
14 (e) Find the output of the following
program:
SAMPLE PAPER 2009 SET II 2
Choice=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;
}
Answer:
TiLeP550
AiLJP430
(1 Mark for each line of output)
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];
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;
}
ANS:
#agaSbarr
(2 Marks for correct line of output)
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;
16 (e) Find the output of the following
program:
SAMPLE PAPER 2010 SET II 2
Choice=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;
}
ANS:
TiLeP550
AiLJP430
(1 Mark for each line of output)
17 SAMPLE PAPER 2012 SET I
17 SAMPLE PAPER 2012 SET I
17 SAMPLE PAPER 2012 SET I
18 SAMPLE PAPER 2012 SET II
18 SAMPLE PAPER 2012 SET II
THAN
K
YOU

More Related Content

What's hot

Java Programming Workshop
Java Programming WorkshopJava Programming Workshop
Java Programming Workshop
neosphere
 
Arrays in c
Arrays in cArrays in c
1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professional1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professional
Isabella789
 
Computer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commandsComputer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commands
Vishvjeet Yadav
 
Implementing stack
Implementing stackImplementing stack
Implementing stack
mohamed sikander
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
premrings
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st Study
Chris Ohk
 
Program for hamming code using c
Program for hamming code using cProgram for hamming code using c
Program for hamming code using csnsanth
 
Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2
Abdul Haseeb
 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3
Abdul Haseeb
 
Network lap pgms 7th semester
Network lap pgms 7th semesterNetwork lap pgms 7th semester
Network lap pgms 7th semesterDOSONKA Group
 
Inheritance and polymorphism
Inheritance and polymorphismInheritance and polymorphism
Inheritance and polymorphism
mohamed sikander
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans incnayakq
 
Python workshop session 6
Python workshop session 6Python workshop session 6
Python workshop session 6
Abdul Haseeb
 
Understanding storage class using nm
Understanding storage class using nmUnderstanding storage class using nm
Understanding storage class using nm
mohamed sikander
 
project report in C++ programming and SQL
project report in C++ programming and SQLproject report in C++ programming and SQL
project report in C++ programming and SQL
vikram mahendra
 
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)
Lab manual data structure (cs305 rgpv) (usefulsearch.org)  (useful search)Lab manual data structure (cs305 rgpv) (usefulsearch.org)  (useful search)
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)
Make Mannan
 
Effective C#
Effective C#Effective C#
Effective C#
lantoli
 

What's hot (20)

Java Programming Workshop
Java Programming WorkshopJava Programming Workshop
Java Programming Workshop
 
Qno 1 (f)
Qno 1 (f)Qno 1 (f)
Qno 1 (f)
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professional1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professional
 
Computer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commandsComputer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commands
 
Implementing stack
Implementing stackImplementing stack
Implementing stack
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st Study
 
Revision1schema C programming
Revision1schema C programmingRevision1schema C programming
Revision1schema C programming
 
Program for hamming code using c
Program for hamming code using cProgram for hamming code using c
Program for hamming code using c
 
Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2
 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3
 
Network lap pgms 7th semester
Network lap pgms 7th semesterNetwork lap pgms 7th semester
Network lap pgms 7th semester
 
Inheritance and polymorphism
Inheritance and polymorphismInheritance and polymorphism
Inheritance and polymorphism
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans inc
 
Python workshop session 6
Python workshop session 6Python workshop session 6
Python workshop session 6
 
Understanding storage class using nm
Understanding storage class using nmUnderstanding storage class using nm
Understanding storage class using nm
 
project report in C++ programming and SQL
project report in C++ programming and SQLproject report in C++ programming and SQL
project report in C++ programming and SQL
 
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)
Lab manual data structure (cs305 rgpv) (usefulsearch.org)  (useful search)Lab manual data structure (cs305 rgpv) (usefulsearch.org)  (useful search)
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)
 
Effective C#
Effective C#Effective C#
Effective C#
 

Viewers also liked

4 Classes & Objects
4 Classes & Objects4 Classes & Objects
4 Classes & Objects
Praveen M Jigajinni
 
8 Pointers
8 Pointers8 Pointers
6 Inheritance
6 Inheritance6 Inheritance
6 Inheritance
Praveen M Jigajinni
 
Computer Overview
Computer OverviewComputer Overview
Computer Overview
Praveen M Jigajinni
 
10 Linked Lists Sacks and Queues
10 Linked Lists Sacks and Queues10 Linked Lists Sacks and Queues
10 Linked Lists Sacks and Queues
Praveen M Jigajinni
 
User Defined Functions
User Defined FunctionsUser Defined Functions
User Defined Functions
Praveen M Jigajinni
 
Structures
StructuresStructures
Getting Started with C++
Getting Started with C++Getting Started with C++
Getting Started with C++
Praveen M Jigajinni
 
Stacks & Queues By Ms. Niti Arora
Stacks & Queues By Ms. Niti AroraStacks & Queues By Ms. Niti Arora
Stacks & Queues By Ms. Niti Arora
kulachihansraj
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
hishamrizvi
 
Linked list
Linked listLinked list
Linked list
akshat360
 
CBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationCBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL Presentation
Guru Ji
 

Viewers also liked (20)

Qno 2 (b)
Qno 2 (b)Qno 2 (b)
Qno 2 (b)
 
4 Classes & Objects
4 Classes & Objects4 Classes & Objects
4 Classes & Objects
 
Qno 1 (b)
Qno 1 (b)Qno 1 (b)
Qno 1 (b)
 
8 Pointers
8 Pointers8 Pointers
8 Pointers
 
Qno 1 (a)
Qno 1 (a)Qno 1 (a)
Qno 1 (a)
 
6 Inheritance
6 Inheritance6 Inheritance
6 Inheritance
 
Qno 2 (a)
Qno 2 (a)Qno 2 (a)
Qno 2 (a)
 
Qno 2 (c)
Qno 2 (c)Qno 2 (c)
Qno 2 (c)
 
Qno 3 (a)
Qno 3 (a)Qno 3 (a)
Qno 3 (a)
 
9 Arrays
9 Arrays9 Arrays
9 Arrays
 
Computer Overview
Computer OverviewComputer Overview
Computer Overview
 
10 Linked Lists Sacks and Queues
10 Linked Lists Sacks and Queues10 Linked Lists Sacks and Queues
10 Linked Lists Sacks and Queues
 
User Defined Functions
User Defined FunctionsUser Defined Functions
User Defined Functions
 
Structures
StructuresStructures
Structures
 
Getting Started with C++
Getting Started with C++Getting Started with C++
Getting Started with C++
 
Stacks & Queues By Ms. Niti Arora
Stacks & Queues By Ms. Niti AroraStacks & Queues By Ms. Niti Arora
Stacks & Queues By Ms. Niti Arora
 
Pointer in c++ part1
Pointer in c++ part1Pointer in c++ part1
Pointer in c++ part1
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
 
Linked list
Linked listLinked list
Linked list
 
CBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationCBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL Presentation
 

Similar to Qno 1 (e)

2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_paper
vandna123
 
Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)
Syed Umair
 
Computer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperComputer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperDeepak Singh
 
Program presentation
Program presentationProgram presentation
Program presentation
MdAlauddinRidoy
 
Cbse question-paper-computer-science-2009
Cbse question-paper-computer-science-2009Cbse question-paper-computer-science-2009
Cbse question-paper-computer-science-2009Deepak Singh
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd Study
Chris Ohk
 
Hello, I need some assistance in writing a java program THAT MUST US.pdf
Hello, I need some assistance in writing a java program THAT MUST US.pdfHello, I need some assistance in writing a java program THAT MUST US.pdf
Hello, I need some assistance in writing a java program THAT MUST US.pdf
FashionColZone
 
Assignement of c++
Assignement of c++Assignement of c++
Assignement of c++
Syed Umair
 
Write C++ program that when given a value N(read from cin)- produces a.docx
Write C++ program that when given a value N(read from cin)- produces a.docxWrite C++ program that when given a value N(read from cin)- produces a.docx
Write C++ program that when given a value N(read from cin)- produces a.docx
karlynwih
 
Midterm cpp q_a_may_2014(2)
Midterm cpp q_a_may_2014(2)Midterm cpp q_a_may_2014(2)
Midterm cpp q_a_may_2014(2)
Mzr Zia
 
pattern-printing-in-c.pdf
pattern-printing-in-c.pdfpattern-printing-in-c.pdf
pattern-printing-in-c.pdf
RSathyaPriyaCSEKIOT
 
C++ TUTORIAL 3
C++ TUTORIAL 3C++ TUTORIAL 3
C++ TUTORIAL 3
Farhan Ab Rahman
 
CODING QUESTIONS.pptx
CODING QUESTIONS.pptxCODING QUESTIONS.pptx
CODING QUESTIONS.pptx
rani marri
 
PRACTICAL COMPUTING
PRACTICAL COMPUTINGPRACTICAL COMPUTING
PRACTICAL COMPUTING
Ramachendran Logarajah
 
Ejercicios de programacion
Ejercicios de programacionEjercicios de programacion
Ejercicios de programacionJeff Tu Pechito
 
CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011
Deepak Singh
 
Pattern printing-in-c(Jaydip Kikani)
Pattern printing-in-c(Jaydip Kikani)Pattern printing-in-c(Jaydip Kikani)
Pattern printing-in-c(Jaydip Kikani)
Jaydip JK
 
Lập trình C
Lập trình CLập trình C
Lập trình C
Viet NguyenHoang
 
CLASS XII COMPUTER SCIENCE MONTHLY TEST PAPER
CLASS XII COMPUTER SCIENCE MONTHLY TEST  PAPERCLASS XII COMPUTER SCIENCE MONTHLY TEST  PAPER
CLASS XII COMPUTER SCIENCE MONTHLY TEST PAPER
Rc Os
 
Computer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfComputer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdf
HIMANSUKUMAR12
 

Similar to Qno 1 (e) (20)

2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_paper
 
Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)
 
Computer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperComputer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paper
 
Program presentation
Program presentationProgram presentation
Program presentation
 
Cbse question-paper-computer-science-2009
Cbse question-paper-computer-science-2009Cbse question-paper-computer-science-2009
Cbse question-paper-computer-science-2009
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd Study
 
Hello, I need some assistance in writing a java program THAT MUST US.pdf
Hello, I need some assistance in writing a java program THAT MUST US.pdfHello, I need some assistance in writing a java program THAT MUST US.pdf
Hello, I need some assistance in writing a java program THAT MUST US.pdf
 
Assignement of c++
Assignement of c++Assignement of c++
Assignement of c++
 
Write C++ program that when given a value N(read from cin)- produces a.docx
Write C++ program that when given a value N(read from cin)- produces a.docxWrite C++ program that when given a value N(read from cin)- produces a.docx
Write C++ program that when given a value N(read from cin)- produces a.docx
 
Midterm cpp q_a_may_2014(2)
Midterm cpp q_a_may_2014(2)Midterm cpp q_a_may_2014(2)
Midterm cpp q_a_may_2014(2)
 
pattern-printing-in-c.pdf
pattern-printing-in-c.pdfpattern-printing-in-c.pdf
pattern-printing-in-c.pdf
 
C++ TUTORIAL 3
C++ TUTORIAL 3C++ TUTORIAL 3
C++ TUTORIAL 3
 
CODING QUESTIONS.pptx
CODING QUESTIONS.pptxCODING QUESTIONS.pptx
CODING QUESTIONS.pptx
 
PRACTICAL COMPUTING
PRACTICAL COMPUTINGPRACTICAL COMPUTING
PRACTICAL COMPUTING
 
Ejercicios de programacion
Ejercicios de programacionEjercicios de programacion
Ejercicios de programacion
 
CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011
 
Pattern printing-in-c(Jaydip Kikani)
Pattern printing-in-c(Jaydip Kikani)Pattern printing-in-c(Jaydip Kikani)
Pattern printing-in-c(Jaydip Kikani)
 
Lập trình C
Lập trình CLập trình C
Lập trình C
 
CLASS XII COMPUTER SCIENCE MONTHLY TEST PAPER
CLASS XII COMPUTER SCIENCE MONTHLY TEST  PAPERCLASS XII COMPUTER SCIENCE MONTHLY TEST  PAPER
CLASS XII COMPUTER SCIENCE MONTHLY TEST PAPER
 
Computer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfComputer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdf
 

More from Praveen M Jigajinni

Chapter 09 design and analysis of algorithms
Chapter 09  design and analysis of algorithmsChapter 09  design and analysis of algorithms
Chapter 09 design and analysis of algorithms
Praveen M Jigajinni
 
Chapter 08 data file handling
Chapter 08 data file handlingChapter 08 data file handling
Chapter 08 data file handling
Praveen M Jigajinni
 
Chapter 07 inheritance
Chapter 07 inheritanceChapter 07 inheritance
Chapter 07 inheritance
Praveen M Jigajinni
 
Chapter 06 constructors and destructors
Chapter 06 constructors and destructorsChapter 06 constructors and destructors
Chapter 06 constructors and destructors
Praveen M Jigajinni
 
Chapter 05 classes and objects
Chapter 05 classes and objectsChapter 05 classes and objects
Chapter 05 classes and objects
Praveen M Jigajinni
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programming
Praveen M Jigajinni
 
Chapter 03 python libraries
Chapter 03 python librariesChapter 03 python libraries
Chapter 03 python libraries
Praveen M Jigajinni
 
Chapter 02 functions -class xii
Chapter 02   functions -class xiiChapter 02   functions -class xii
Chapter 02 functions -class xii
Praveen M Jigajinni
 
Unit 3 MongDB
Unit 3 MongDBUnit 3 MongDB
Unit 3 MongDB
Praveen M Jigajinni
 
Chapter 17 Tuples
Chapter 17 TuplesChapter 17 Tuples
Chapter 17 Tuples
Praveen M Jigajinni
 
Chapter 15 Lists
Chapter 15 ListsChapter 15 Lists
Chapter 15 Lists
Praveen M Jigajinni
 
Chapter 14 strings
Chapter 14 stringsChapter 14 strings
Chapter 14 strings
Praveen M Jigajinni
 
Chapter 13 exceptional handling
Chapter 13 exceptional handlingChapter 13 exceptional handling
Chapter 13 exceptional handling
Praveen M Jigajinni
 
Chapter 10 data handling
Chapter 10 data handlingChapter 10 data handling
Chapter 10 data handling
Praveen M Jigajinni
 
Chapter 9 python fundamentals
Chapter 9 python fundamentalsChapter 9 python fundamentals
Chapter 9 python fundamentals
Praveen M Jigajinni
 
Chapter 8 getting started with python
Chapter 8 getting started with pythonChapter 8 getting started with python
Chapter 8 getting started with python
Praveen M Jigajinni
 
Chapter 7 basics of computational thinking
Chapter 7 basics of computational thinkingChapter 7 basics of computational thinking
Chapter 7 basics of computational thinking
Praveen M Jigajinni
 
Chapter 6 algorithms and flow charts
Chapter 6  algorithms and flow chartsChapter 6  algorithms and flow charts
Chapter 6 algorithms and flow charts
Praveen M Jigajinni
 
Chapter 5 boolean algebra
Chapter 5 boolean algebraChapter 5 boolean algebra
Chapter 5 boolean algebra
Praveen M Jigajinni
 
Chapter 4 number system
Chapter 4 number systemChapter 4 number system
Chapter 4 number system
Praveen M Jigajinni
 

More from Praveen M Jigajinni (20)

Chapter 09 design and analysis of algorithms
Chapter 09  design and analysis of algorithmsChapter 09  design and analysis of algorithms
Chapter 09 design and analysis of algorithms
 
Chapter 08 data file handling
Chapter 08 data file handlingChapter 08 data file handling
Chapter 08 data file handling
 
Chapter 07 inheritance
Chapter 07 inheritanceChapter 07 inheritance
Chapter 07 inheritance
 
Chapter 06 constructors and destructors
Chapter 06 constructors and destructorsChapter 06 constructors and destructors
Chapter 06 constructors and destructors
 
Chapter 05 classes and objects
Chapter 05 classes and objectsChapter 05 classes and objects
Chapter 05 classes and objects
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programming
 
Chapter 03 python libraries
Chapter 03 python librariesChapter 03 python libraries
Chapter 03 python libraries
 
Chapter 02 functions -class xii
Chapter 02   functions -class xiiChapter 02   functions -class xii
Chapter 02 functions -class xii
 
Unit 3 MongDB
Unit 3 MongDBUnit 3 MongDB
Unit 3 MongDB
 
Chapter 17 Tuples
Chapter 17 TuplesChapter 17 Tuples
Chapter 17 Tuples
 
Chapter 15 Lists
Chapter 15 ListsChapter 15 Lists
Chapter 15 Lists
 
Chapter 14 strings
Chapter 14 stringsChapter 14 strings
Chapter 14 strings
 
Chapter 13 exceptional handling
Chapter 13 exceptional handlingChapter 13 exceptional handling
Chapter 13 exceptional handling
 
Chapter 10 data handling
Chapter 10 data handlingChapter 10 data handling
Chapter 10 data handling
 
Chapter 9 python fundamentals
Chapter 9 python fundamentalsChapter 9 python fundamentals
Chapter 9 python fundamentals
 
Chapter 8 getting started with python
Chapter 8 getting started with pythonChapter 8 getting started with python
Chapter 8 getting started with python
 
Chapter 7 basics of computational thinking
Chapter 7 basics of computational thinkingChapter 7 basics of computational thinking
Chapter 7 basics of computational thinking
 
Chapter 6 algorithms and flow charts
Chapter 6  algorithms and flow chartsChapter 6  algorithms and flow charts
Chapter 6 algorithms and flow charts
 
Chapter 5 boolean algebra
Chapter 5 boolean algebraChapter 5 boolean algebra
Chapter 5 boolean algebra
 
Chapter 4 number system
Chapter 4 number systemChapter 4 number system
Chapter 4 number system
 

Recently uploaded

Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 

Recently uploaded (20)

Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 

Qno 1 (e)

  • 1. XII CBSE Previous Year Question Paper QUESTION NO 1 (E) 2 or 3 Marks
  • 2. 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; else S+=R; NUM /=10; }while(NUM>0); cout<<F-S; }
  • 3. 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 least 1 mark in the entire Q. No. 1 i.e. from 1(a) to 1(f))
  • 4. 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; else Second+=R; Number /=10; }while(Number>0); cout<<First-Second; }
  • 5. (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)
  • 6. 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); }
  • 7. 3 (e) Find the output of the following program : Delhi 2007 3 void main() { int Number=20; Direct(Number) ; Indirect(); cout<< “ Number=” <<Number<<endl ; }
  • 8. (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
  • 9. 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); }
  • 10. 4 (e) Find the output of the following program : OD 2007 3 void main () { int YourNum=20; Control (YourNum); Withdef(); cout<<”Number=”<<YourNum<<endl; }
  • 11. (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
  • 12. 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; } }
  • 13. 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)
  • 14. 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; } }
  • 15. Ans: Line1=5&8 Line2=11&9 Line1=6&9 Line2=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
  • 16. 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 ; }
  • 17. 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]) ; else Info[I] = Info[I] +N ; }
  • 18. 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)
  • 19. 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; }
  • 20. 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]); else Msg[C] = Msg[C]-N; }
  • 21. 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)
  • 22. 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]); else if (Text[K]=’E’ || Text[K]==’e’) Text[K]= =C;
  • 23. 9 (e) Find the output of the following program : Delhi 2010 2 else if (K%2==O) Text[K]=toupper(Text[K]); else Text[K]=Text[K-l]; } }
  • 24. 9 (e) Find the output of the following program : Delhi 2010 2 void main ( ) { char OldText[ ]=”pOwERALone”; ChangeIt(OldText,’%’); cout<<“New TEXT:”<<OldText<<endl; }
  • 25. Ans. 16, 24, 6 6, 34, 16 18, 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 ‘,’ missing Deduct (½ Mark if endl is not considered at the right positions
  • 26. 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]); else if (Msg[Cnt]==’A’|| Msg[Cnt]==’a’) Msg[Cnt]=CH;
  • 27. 10 (e) Find the output of the following program: OD 2010 2 else if (Cnt%2==0) Msg[Cnt]=toupper(Msg[Cnt]); else Msg[Cnt]=Msg[Cnt-l]; } } void main () { char MyText [] =” ApEACeDriVE”; MyCode(MyText,’@’); cout<<“NEW TEXT:”<<MyText<<endl; }
  • 28. 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:
  • 29. 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 ; }
  • 30. Ans Striker>10 Next@50 Last@40 Reset to 0 (½ for writing each line of output correctly) Note: Deduct ½ Mark if any/all special characters are missing Deduct ½ Mark if endl is not considered at the right positions
  • 31. 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; }
  • 32. Ans Queen @11 Now @55 Finally @44 New 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
  • 33. 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]='@'; }
  • 34. 13 (e) Find the output of the following program: SAMPLE PAPER 2009 SET I 2 void main() { char Text[]="SaVE EArtH";//The two words in the string Text //are separated by single space Encrypt(Text); cout<<Text<<endl; }
  • 35. 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)
  • 36. 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;
  • 37. 14 (e) Find the output of the following program: SAMPLE PAPER 2009 SET II 2 Choice=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; }
  • 39. 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];
  • 40. 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; }
  • 41. ANS: #agaSbarr (2 Marks for correct line of output)
  • 42. 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;
  • 43. 16 (e) Find the output of the following program: SAMPLE PAPER 2010 SET II 2 Choice=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; }
  • 44. ANS: TiLeP550 AiLJP430 (1 Mark for each line of output)
  • 45. 17 SAMPLE PAPER 2012 SET I
  • 46. 17 SAMPLE PAPER 2012 SET I
  • 47. 17 SAMPLE PAPER 2012 SET I
  • 48. 18 SAMPLE PAPER 2012 SET II
  • 49. 18 SAMPLE PAPER 2012 SET II