Sunteți pe pagina 1din 21

Model Question Paper

Subject Code: BC0034


Subject Name: Computer concepts & C Programming
Credits: 4
Marks: 140

1. C language is developed by --------------A) Martin


B ) Charles Babbage
C) Dennis Ritchie
D) Claude Shanon
2. C language is strongly associated with -----------------A) UNIX
B) FORTRAN
C) COBOL
D) none of these
3. A C program can be viewed as a group of building blocks called ------------A) structures
B) functions
C)keywords
D)switchs
4. Every statement in C program must terminate with---------------.
A) semi colon
B) colon

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

9. Operators are used in programs to manipulate ----------------.


A) data
B) variables
C) keywords
D) both A) and B)
10. The ------------------ operator gives you the remainder when two integers are divided.
A)%

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

13. The size of floating point data is ----------------.


A) 32 bits
B) 16 bits
C) 8 bits
D) 4 bits
14. A double data type uses --------------- bits.
A) 8
B) 4
C) 16
D) 64
15. All keywords must be written in --------------------A) uppercases
B) lowercase
C) either A) or B)
D) Should start with underscore
16. Keywords are also called--------------.
A) builtin functions
B) default words
C) reserved words
D) control words

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

D) 100 144 100


21. ------------- is a unconditional control statement.
A) for
B) goto
C) switch
D) default
22. The -------------- statement requires a label in order to identify the place where the branch is
to be made.
A) for
B) switch
C) goto
D) break

23. It is a good programming practice to avoid the use of ------------------ statement.


A)switch
B) for
C) default
D) goto
24. if statement is also called ------------------ statement.
A) looping
B) exit
C) conditional control
D) unconditional control

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

27. It is a good programming practice to avoid the use of ------------------ statement.


A)switch
B) for
C) default
D) goto
28. The ------------------------- causes the control to go directly to the test-condition and then to
continue the iteration process.
A) break
B) continue
C) default
D) cont

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)

33. ------------------- are channels of communication within a program.


A) variables
B) structures
C) functions
D) constants
34. 2. Variable which can be recognized only within a single function is called------------------.
A) Global variable
B) Local variable
C) Extern variable
D) Static variable
35. ---------------------------- refers to the persistence of a variable and its scope within the
program.
A) labels
B) recursion
C) inheritance
D) Storage class
36. Variables declared within functions are called--------- variables.
A) global
B) local
C) internal
D) inner
37. ------------------- is a collection of similar type of elements.
A)

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()

43. Identify a valid variable name from the following list.


i.
ii.
iii.
iv.
v.
A)
B)
C)
D)

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)

&&
||
->
?:

46. What is the value of the following arithmetic expression?


14 % 3 + 7 % 2
A) 5
B) 6
C) 3
D) 2
47. Which of the following is a valid keyword ?
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)

51. The conditional operator takes ----------- operands.


A)
two
B)
nil
C)
one
D)
three
Ans : D) three
52. --------------- is substitute for a long if statement.
A) else if statement
B) switch statement
C) for statement
D) default statement

53. The conditional operator does not produce ----------------.


A) result
B) lvalue
C) rvalue
D) constant
54. The conditional operator is also called------------operator.
A) ternary
B) binary

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)

56. Which of these loops is / are a exit controlled loop.


A)
for loop
B)
while loop
C)
do while loop
D)
both A) and B)
57. A for loop contaions ----------------.
A) initial expression
B) update expression
C) loop condition
D) all of these

58. Identify the syntax of a for loop.


A) for(expr1; expr2; expr3)
B) for(expr1: expr2 : expr3)
C) for(expr1, expr2, expr3)
D) for(expr1 expr2 expr3);
59. In a structure the link between a member and a variable is established using the ---------operator.
A)
B)
C)
D)

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

61. State true or false


i.
ii.
iii.

C compilers are commonly available for computers of all sizes.


C language was developed along with the Windows operating system, it is strongly
associated with Windows.
A C program can be viewed as a group of building blocks called functions.

A) true, true, false B) true, false, true C) false, true, true D) false, true, false

62. Match the following

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

63. Match the following

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

64. State true or false


i. A character constant is formed by enclosing the character within a pair of double quote
marks..
ii. If the operands are of different data types, the lower type is automatically converted to the
higher type before the operation proceeds.
iii. When one of the operands is real and the other is integer, the expression is called a mixedmode arithmetic expression.
A)
B)
C)
D)

true , true, true


false, false, false
true, false, true
false, true, true

65. State true or false


i. gets() and puts() functions facilitate the transfer of strings between the computer and the
standard input/output devices.
ii. getchar() function is used to accept a single character from the keyboard and putchar()
function is used to display single character on the users screen.

iii. scanf() and printf() are the two formatted input/output functions.

A)
B)
C)
D)

true , true, true


false, false, false
true, false, true
false, true, true

66. Match the following


I.
II.
III.
IV.
A)
B)
C)
D)

goto
switch
?:
if

1. default
2. unconditional
3. conditional
4. ternary

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

67. Match the following


I.
II.
III.
IV.
A)
B)
C)
D)

Do while
while
break
for

1. switch
2. exit controlled
3. inital, loop condition, update expressions
4. entry controlled

I- 4 II-3 III-1 IV-2


I-3 II-4 III-2 IV-1
I-2 II-4 III-1 IV-3
1-4 II-2 III-1 IV- 3

68. State true or false


i. The function main() is optional in a C program
ii. The keyword extern is optional in function prototype declarations
iii The towers of Hanoi problem is best example for recursion.
A)
B)
C)
D)

true , true, true


false, false, false
true, false, true
false, true, true

69. State true or false


i.
ii.
iii.

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)

true , true, true


false, false, true
true, false, true
false, true, true

70. State true or false


i. The scope of static variables and automatic variables is the same.
ii. By default, a static variable is initialized to zero.
iii. To make a variable as an external declaration, which is defined somewhere else,
you precede it with the keyword extern.
A)
B)
C)
D)

true , true, true


false, false, false
true, false, true
false, true, true

71. State true or false


i. The variables declared in the main() function are the global variables.

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)

true , true, true


false, false, true
true, false, true
false, true, true

72. What is the output of the following program segment?

char str1[10];
str1=Hello, world;
printf(%s, str1);
A)
B)
C)
D)

Hello, world
=Hello, world
Compilation error
Syntax error

73. State true or false


ii.
iii.

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)

true , true, true


false, false, true
true, false, true
false, true, true

74. What is the output of the following program segment?


char str1[10];
str1=Hello, world;
printf(%s, str1);
A)
B)
C)
D)

Hello, world
=Hello, world
Compilation error
Syntax error

75. State true or false


i.
All elements in the array are referred with the array name.
ii.
Structure is a method for packing data of different types.
iii.

The compiler allocates storage for the smallest member of the union.
A) true , true, true
B) false, false, true

C) true, true, false


D) false, true, 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

S-ar putea să vă placă și