Computer Programming Mid - I, January - 2015
1.Which of the following is an informal description of a sequence of steps for solving a problem
-
flow chart
-
algorithm
-
pseudo code
-
program
-
Answer: C
2.A language translator that translates and executes a program line by line is _____
-
compiler
-
interpreter
-
loader
-
linker
-
Answer: B
3.Which of the following is not a valid variable name declaration?
-
int _a3;
-
int a_3;
-
int 3_a;
-
int _3a;
-
Answer: C
4.Which data type is most suitable for storing a number 65000 in a 32-bit system?
-
short
-
int
-
long
-
double
-
Answer: A
5.Which of the following declaration is not supported by C?
-
String str;
-
char *str;
-
float str = 3e2;
-
int str = 123;
-
Answer: A
6.If no precision is specified for floating point number then printf( ) prints _____________ decimal positions.
-
zero
-
two
-
four
-
six
-
Answer: D
7.The two different ways to implement a multi way selection in C are ____________
-
if..else & switch
-
else..if & switch
-
if..else & case
-
else..if & case
-
Answer: B
8.How many times is a do-while loop guarantee to loop?
-
0
-
1
-
infinitely
-
variable
-
Answer: B
9.What is the result of 8 | 4?
-
0
-
1
-
4
-
12
-
Answer: D
10.Which of the following loop construct is a post-test loop?
-
for
-
while
-
do-while
-
all
-
Answer: C
11.A sequence of characters invented by the programmer to identify or name a specific object is called ______________.
Answer: an identifier
12.The file created from the compiler is known as __________ file.
Answer: object module
13.The basic component of a C program is the ___________.
Answer: function
14._____________ is a sequence if operators and operands that reduces to a single value.
Answer: An expression
15.The labeled statement is used for selection in a __________ statement.
Answer: switch
16.______________ problem occurs when there is no matching else.
Answer: dangling else
17.C provides ___________ as a convenient alternative to the traditional if-else for two way selection.
Answer: conditional expression
18.A character constant is enclosed in ______________.
Answer: single quotes
19.The bit wise operator that is used to multiply a data item with power of 2 is ________.
Answer: left shift (<<) operator
20.A loop that is contained within another loop is called ____________.
Answer: a nested loop