Académique Documents
Professionnel Documents
Culture Documents
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 --------------------------------------------------------------------------------------------------------------------------
Marks: 140
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
A)6 B) 8 C) 16 D) 32 7. The ____________ of a variable determines what kinds of values it may take on.
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
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 called __________________. A) NUl B) EOF C) Nil D) 1010 18. What is the output of the following program segment?
19. To print an int argument in octal, you can use ___ format string
printf( %d %o %x , 100, 100, 100); A) 100 100 100 B) 100 100 64 C) 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) switch C) goto D) break
A)switch B) for C) default D) goto 24. if statement is also called ------------------ statement.
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
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, 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
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
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.
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
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) ?:
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)
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
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) 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
60. A___________ is a convenient tool for handling a group of logically related data items. A) array B) function C) structure D) loop
i. C compilers are commonly available for computers of all sizes. ii. C language was developed along with the Windows operating system, it is strongly associated 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
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 D) 1-4 II-2 III-1 IV- 3
63. Match the following I. ? : 1. relational operator II. Sizeof() 2. works only on integer data III. == 3. compile time operator IV. % 4. ternary operator
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 D) 1-4 II-2 III-1 IV- 3
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 mixed-mode arithmetic expression. A) true , true, true B) false, false, 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) true , true, true B) false, false, false C) true, false, true D) false, true, true
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
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
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
i. The arguments that appear in function definition are called actual arguments ii. 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
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) true , true, true B) false, false, false C) true, false, true D) false, true, true
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) true , true, true B) false, false, true C) true, false, true D) false, true, true
char str1[10]; str1=Hello, world; printf(%s, str1); A) Hello, world B) =Hello, world C) Compilation error D) Syntax error
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
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