mca1020-model question paper
TRANSCRIPT
-
8/13/2019 MCA1020-Model Question Paper
1/23
Model Question Paper
Subject Code: MCA1020
Subject Name: Programming in C
Credits: 4 Marks: 140
Notes:
1. Question paper is divided into three parts i.e. Part A, Part B, and Part C.
2. Part A consist 40 questions of 1 mark each
3. Part B consist 20 questions of 2 marks each.4. Part C consist 15 questions of 4 marks each.
5. All questions are compulsory
--------------------------------------------------------------------------------------------------------------------------
Part A (One mark questions)
1. C language is developed by ---------------
A) Martin
B ) Charles BabbageC) 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 -------------
-
8/13/2019 MCA1020-Model Question Paper
2/23
A) structures
B) functions
C)keywordsD)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
-
8/13/2019 MCA1020-Model Question Paper
3/23
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
-
8/13/2019 MCA1020-Model Question Paper
4/23
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
-
8/13/2019 MCA1020-Model Question Paper
5/23
D) control words
17. In order to stop reading the input character, you can use a value called
__________________.
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) ErrorD) 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.
-
8/13/2019 MCA1020-Model Question Paper
6/23
printf( %d %o %x , 100, 100, 100);
A) 100 100 100
B) 100 100 64C) 100 144 64
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) switchC) 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.
-
8/13/2019 MCA1020-Model Question Paper
7/23
A) looping
B) exit
C) conditional controlD) 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) switchC) break
D) goto
27. It is a good programming practice to avoid the use of ------------------ statement.
A)switch
B) for
C) default
D) goto
-
8/13/2019 MCA1020-Model Question Paper
8/23
28. The ------------------------- causes the control to go directly to the test-condition and
then to continue the iteration process.
A) breakB) continue
C) default
D) cont
29. .------------------is a self-contained program segment that carries out some specific,
well-defined 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
-
8/13/2019 MCA1020-Model Question Paper
9/23
32. Each argument of a function should have-----------.
A) name
B) typeC) 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 variableC) 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
-
8/13/2019 MCA1020-Model Question Paper
10/23
B) local
C) internal
D) inner37. ------------------- 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
-
8/13/2019 MCA1020-Model Question Paper
11/23
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. sum
ii. avg
iii. s,um
iv. average
v. 9total
A) i, iii, iv, and v only
B) i, ii, and iv only
C) i, and iv only
D) ii,iii,iv and v only
-
8/13/2019 MCA1020-Model Question Paper
12/23
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) auto
B) whil
C) lse
-
8/13/2019 MCA1020-Model Question Paper
13/23
D) 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) c= A , i= 97
B) c=a, i= A
C) c= A , i=a
D) 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)
-
8/13/2019 MCA1020-Model Question Paper
14/23
51. The conditional operator takes ----------- operands.
A) two
B) nilC) 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.
-
8/13/2019 MCA1020-Model Question Paper
15/23
A) for loop
B) while loop
C) do while loopD) 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) asterik
-
8/13/2019 MCA1020-Model Question Paper
16/23
B) dot
C) matrix
D) 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. C compilers are commonly available for computers of all sizes.
ii. C language was developed along with the Windows operating system, it is stronglyassociated with Windows.
iii. 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. Integer 1. keyword
II. float 2. Does not vary
III. static 3. 16 bits
IV. constant 4. 8 bits
-
8/13/2019 MCA1020-Model Question Paper
17/23
-
8/13/2019 MCA1020-Model Question Paper
18/23
C) true, false, true
D) 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 user s screen.
iii. scanf() and printf() are the two formatted input/output functions.
A) true , true, true
B) false, false, false
C) true, false, true
D) false, true, true
66. Match the following
I. goto 1. default
II. switch 2. unconditional
III. ? : 3. conditional
IV. if 4. ternary
A) I- 4 II-3 III-1 IV-2
B) I-3 II-4 III-2 IV-1
C) I-2 II-1 III-4 IV-3
-
8/13/2019 MCA1020-Model Question Paper
19/23
D) 1-4 II-2 III-1 IV- 3
67. Match the following
I. Do while 1. switch
II. while 2. exit controlled
III. break 3. inital, loop condition, update expressions
IV. for 4. entry controlled
A) I- 4 II-3 III-1 IV-2
B) I-3 II-4 III-2 IV-1
C) I-2 II-4 III-1 IV-3
D) 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) true , true, true
B) false, false, false
C) true, false, true
D) false, true, true
-
8/13/2019 MCA1020-Model Question Paper
20/23
69. State true or false
i. The arguments that appear in function definition are called actual argumentsii. The arguments that appear when the function is called are the formal arguments.
iii. The function prototype is nothing but the function declaration.
A) true , true, true
B) false, false, true
C) true, false, true
D) 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, youprecede it with the keyword extern .
A) true , true, true
B) false, false, false
C) true, false, true
D) 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.
-
8/13/2019 MCA1020-Model Question Paper
21/23
Iii The function prototype is nothing but the function declaration.
A) true , true, true
B) false, false, trueC) true, false, true
D) false, true, true
72. What is the output of the following program segment?
char str1[10];
str1=Hello, world;
printf(%s, str1);
A) Hello, world
B) =Hello, world
C) Compilation error
D) Syntax error
73. State true or false
ii. All elements in the array are referred with the array name.
iii. 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) true , true, true
B) false, false, true
C) true, false, true
-
8/13/2019 MCA1020-Model Question Paper
22/23
D) false, true, true
74. What is the output of the following program segment?
char str1[10];
str1=Hello, world;
printf(%s, str1);
A) Hello, world
B) =Hello, world
C) Compilation error
D) 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
-
8/13/2019 MCA1020-Model Question Paper
23/23