BC0034-Computer Concepts C Programming-Part-2-MQP PDF
BC0034-Computer Concepts C Programming-Part-2-MQP PDF
C) double quotes
D) single quotes
5. ________is a place where we can store values.
A) Keyword
B) Variable
C) Constant
D) function
6. Size of float data type is _________ bits.
A)6
B) 8
C) 16
D) 32
7. The ____________ of a variable determines what kinds of values it may take on.
A) location
B) name
C) data type
D) time of delcaration
8. ---------------- is a sequence of characters enclosed within double quotes.
A) string constant
B) character constant
C) integer constant
D) any of these
B)+
C) @
E) /
11. The ++ operator is --------------------A) unary
B) binary
C) terneray
D) either A) or B)
12. The -------------- can be used to link the related expressions together..
A) # operator
B) comma operator
C) tild operator
D) semicolon
17. In order to stop reading the input character, you can use a value
__________________.
A) NUl
B) EOF
C) Nil
D) 1010
18. What is the output of the following program segment?
int a=97;
printf(%c, a);
A) a
B) 97
C) Error
D) A
19. To print an int argument in octal, you can use ___ format string
A)%i
B) %e
C) %c
D) %o
20. What is the output of the following statement.
printf( %d %o %x , 100, 100, 100);
A) 100 100 100
B) 100 100 64
C) 100 144 64
called
25. --------------- is used in a situation where we need to execute the body of the loop before the
test is performed.
A) for loop
B) goto statement
C) switch statement
D) do while loop
26. The -------------- statement is used to exit from a loop.
A) for
B) switch
C) break
D) goto
29. .------------------is a self-contained program segment that carries out some specific, welldefined task..
A) loop
B) structure
C) function
D) variable
30. Every C program contains ------------------ functions.
A) one
B) one or more
C) three
D) may be zero
31. ----------------------------are the special identifiers through which information can be passed to
the function..
A) labels
B) variables
C) constants
D) parameters
32. Each argument of a function should have-----------.
A) name
B) type
C) both name and type
D) either A) or B)
Array
B) Structure
C) Function
D) variable
38. What is the library function used to copy one string to another ?
A) strcpy()
B) stcopy()
C) strcopy()
D) stcp()
39. The end of the string is marked with a special character called --------------- .
A) auto
B) EOF
C) the null character
D) none of these
40. Which of these library function is used to concatenate strings.
A) strcmp
B) stcat
C) strct
D) strcat
41. There are some variables that are used in more than one function, which are called----------variables
A) static
B) dynamic
C) local
D) global
42. Which of the following function is used for reading a number from a keyboard ?
A) scanf()
B) getch()
C) printf()
D) readnum()
sum
avg
s,um
average
9total
i, iii, iv, and v only
i, ii, and iv only
i, and iv only
ii,iii,iv and v only
44. ------------- tells the compiler the name and type of a variable you'll be using in your program.
A) initialization
B) declaration
C) definition
D) instantiation
45. Which of the following is a ternary operator ?
A)
B)
C)
D)
&&
||
->
?:
auto
whil
lse
switched
48. If the value of X is 35.2, what is the value of A in the following expression?
A = (int)(X+0.5);
A) 35
B) 35.7
C) 35.2
D) 35.5
49. What is the output of the following program segment
char c = 'A';
int i = 97;
printf("c = %c, i = %d\n", c, i);
A)
B)
C)
D)
c= A , i= 97
c=a, i= A
c= A , i=a
c=97 , i=a
50. Which of these functions facilitate the transfer of strings between the computer and the
standard input/output devices?
A) gets()
B) puts()
C) sets()
D) both A) and B)
C) unary
D) arithmetic
55. Which of these loops is / are a entry controlled loop.
A)
B)
C)
D)
for loop
while loop
do while loop
both A) and B)
asterik
dot
matrix
seed
60. A___________ is a convenient tool for handling a group of logically related data items.
A) array
B) function
C) structure
D) loop
A) true, true, false B) true, false, true C) false, true, true D) false, true, false
I.
II.
III.
IV.
A)
B)
C)
D)
Integer
1. keyword
float
2. Does not vary
static
3. 16 bits
constant 4. 8 bits
I- 4 II-3 III-1 IV-2
I-3 II-4 III-2 IV-1
I-2 II-1 III-4 IV-3
1-4 II-2 III-1 IV- 3
I.
II.
III.
IV.
A)
B)
C)
D)
?:
1. relational operator
Sizeof()
2. works only on integer data
==
3. compile time operator
%
4. ternary operator
I- 4 II-3 III-1 IV-2
I-3 II-4 III-2 IV-1
I-2 II-1 III-4 IV-3
1-4 II-2 III-1 IV- 3
iii. scanf() and printf() are the two formatted input/output functions.
A)
B)
C)
D)
goto
switch
?:
if
1. default
2. unconditional
3. conditional
4. ternary
Do while
while
break
for
1. switch
2. exit controlled
3. inital, loop condition, update expressions
4. entry controlled
The arguments that appear in function definition are called actual arguments
The arguments that appear when the function is called are the formal arguments.
The function prototype is nothing but the function declaration.
A)
B)
C)
D)
ii. The global variables are more secured than the automatic variables in a program.
Iii The function prototype is nothing but the function declaration.
A)
B)
C)
D)
char str1[10];
str1=Hello, world;
printf(%s, str1);
A)
B)
C)
D)
Hello, world
=Hello, world
Compilation error
Syntax error
All elements in the array are referred with the array name.
An array name is a pointer.
iii.
Arrays are not limited to type int; you can have arrays of char or double or any
other type.
A)
B)
C)
D)
Hello, world
=Hello, world
Compilation error
Syntax error
The compiler allocates storage for the smallest member of the union.
A) true , true, true
B) false, false, true
Answer Keys
Part - A
Q. No.
Ans. Key
Part - B
Q. No.
Ans. Key
Q. No.
Ans. Key
Part - C
Q. No.
Ans. Key
1 C
21 B
41 D
61 B
2 A
22 C
42 A
62 A
3 B
23 D
43 B
63 A
4 A
24 C
44 B
64 D
5 B
25 D
45 D
65 A
6 D
26 C
46 C
66 C
7 C
27 D
47 A
67 C
8 A
28 B
48 A
68 D
9 D
29 C
49 A
69 B
10 A
30 B
50 D
70 A
11 A
31 D
51 D
71 B
12 B
32 C
52 B
72 C
13 A
33 A
53 B
73 C
14 D
34 B
54 A
74 C
15 B
35 D
55 D
75 C
16 C
36 B
56 C
17 B
37 A
57 D
18 A
38 A
58 A
19 D
39 C
59 B
20 C
40
60 C