0% found this document useful (0 votes)
71 views

Computer 2nd Year 1st Test

This document contains a computer science exam with multiple choice and written response questions about programming concepts in C++. It is divided into three sections - Section A has 10 multiple choice questions testing concepts like data types, operators, loops and control statements. Section B has short answer written response questions asking to define terms, write code snippets, or differentiate between programming concepts. Section C has two long answer written response questions asking to write programs using loops or explain programming concepts in detail.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

Computer 2nd Year 1st Test

This document contains a computer science exam with multiple choice and written response questions about programming concepts in C++. It is divided into three sections - Section A has 10 multiple choice questions testing concepts like data types, operators, loops and control statements. Section B has short answer written response questions asking to define terms, write code snippets, or differentiate between programming concepts. Section C has two long answer written response questions asking to write programs using loops or explain programming concepts in detail.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Gems world college

NAME:
CLASS: 12TH SUBJECT: COMPUTER
SECTION-A
Q1. CHOOSE THE CORRECT OPTION. (10)
1. Which of the following is ignored during program execution?
a) Reserved words b) Constant c) Comment
2. What is the range of unsigned short integer?
a) 0 to 4294967295 b) 0 to 65535 c) -327678 to 32767
3. Which of the following can be used to replace ternary operator?
a) If statement b) If else statement c) Switch statement
4. In C++ the expression sum=sum+n can also be written as.
a) sum+=n b) sum=n++ c) sum=+n
5. Which of the following is equal to operator?
a) == b) ++ c) <=
6. which of the following transfers control to the beginning of the loop, skipping the remaining
statements?
a) Exit function b) Continue statement c) Nested loop
7. which of the following operators is used to form compound condition?
a) Arthimetic operator b) Assigment operator c) Logical operator
8. How is a single statement for loop teminated?
a) With a color b) With a right bracket c) With a right brace
9. How is a multiple statement for loop terminates?
a) With a semi colon b) With a right brace c) With a colon
10. A while loop is more appropriate to use than a for loop when:
a) When the body of the loop is to be more executed at least once
b) when the program exetutes at least once
c) when the loop terminates unexpectedly
SECTION-B
Q2.Attemt any ten (10) questions. (30)
1. What is the usage of break and continue statements in C programs?
OR
Define reserved word and give six examples.
2. What is nested loop? Give one example.
OR
Why escape sequence is used? Give two examples with explanation.
3. Write the nested loops will print the following patterns.
OR
Differentiate between relational and logical operator.
4. What will be the output of the following code
int a, b, c
A=0; B=1; C=2;
hA+b+c;
B=+aa;
C=b++;
Printf("\na=%d, b=/%d, c=%d",a, b, c);
OR
Why type casting is used? Also write three examples.
5. Write a note on variable.
OR
What is the purpose of exit function?
6. Evaluate the following integer expression.
a: 25%7 b: (20-2)(6+3) c: 4*5/10+8
OR
What will be the output of the following statements
a: Cout<<"17/3 is equal to "<<17/2;
b: Cout<<"10.0/4 is equal to "<<(40/5%3*7);
7. Differentiate between for and while loop.
OR
Why control statements are used in C programs?
8. Write a program that reads an integer and prints its factorial.
OR
Differentiate between Do while loop and while loop.
9. Write a note on for loop.
OR
Write a program that reads length and breadth of a rectangle and prints its area.
10. Write a note on Else if statement.
OR
What is the purpose of using header file in program?
SECTION-C
Attempt any two(2) questions. (20)
1. Write a program that prints the sum of the following sequences using for loop
Sum= 30 + 33 + 36 + 39 +......+60
OR
What is looping control structure? Explain two types of looping statements with syntax and examples.
2. What is meant by precedence of operator? Write the operators with highest precedence at the top
and the lowest at the bottom?
OR
Explain the purpose of switch statement with syntax and one example?

You might also like