CBSE Computer Science Test paper2 Class XI 2010
http://www.cbseguess.com/-------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com Sample Paper – 2010 Class – XI Subject – Computer Science UNIT TEST II (General OOP concept, Getting Started With C++, Data Handling and Programming Paradigm) TIME: 1.30 Hrs Max Marks: 40 ALL QUESTIONS ARE COMPULSURY. PROGRAMMING LANGUAGE IS C++. 1. What are the difference between a keyword and an identifier? 2 2. Write a program in C++ to accept marks in five subjects for a student and display the average mark.4 3. Write the following real constants in exponent form: 17.251, 151.02, 0.00031, 0.452. 2 4. What is the difference between Runtime and Syntax errors? 2 5. What will be the character size of the following constants: „\a‟, “\a”, “sachin\‟s bat”. 2 6. Which one condition every c++ program must fulfill? 1 7. What do you understand by code generation? 1 8. What type of constants are the following: 14,011, 3.123, 0xA. 2 9. Predict and rectify errors: 3 int main() { cout<>num>>auto; float area= length*breadth; cout<>”you are a fool”; http://www.cbseguess.com/-------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com iii) int a; b ; iv) include 17. If a reference to cerr is producing an error, what could be the possible reasons for it? 1 18. Define the term Paradigm. 1 UNIT TEST III (Operators and Expressions) ALL QUESTIONS ARE COMPULSURY. PROGRAMMING LANGUAGE IS C++. 1. What output will be the following code fragment produce? 2 int val, res, n=1000; cin>>val; res = (n+val) >1750 ? 400 : 200; cout<>y;>>j; iii) break = x*y; 3 http://www.cbseguess.com/-------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com 19. If the file iostream.h is not included in a program, what happens? 1 20. What will be the output of the following: 2 cout<< ++a<< ++a<=0;a-=3); cout<>ch; if( ch!=‟\n‟) cout<< “ not a newline”; end: } 15. Predict the output of the following codes: 2 //version 1 //version 2 int f=1,i=2; int f=1,i=2; while(++i<5) do{ f*=I; f*=I; cout<b) a=-1; else b=-1; } 14. Predict the output of the following code: 3 void execute( int & x,int y=200) http://www.cbseguess.com/-------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com { int temp; temp+=y; x+=temp; if( y==200) cout<< temp< #include void main() { clrscr(); int b=0; int C[10]={1,2,3,4,5,6,7,8,9,10}; for( int i=0;i<10;i++) { a. if(c[i]%2==0) i. b+=c[i]; } cout<< “b=”< #include void main() { clrscr(); char *str= “NAVODAYA”; for( int i=0;str[i]!= „\0‟;i++) { for(int j=0;j<=i;j++) cout<
Description
This content is useful for CBSE Students
Presentation Transcript
Your Facebook Friends on WizIQ