You are on page 1of 7

[1] Which of the following statement is correct? Choice a -A character constant in C will never be a digit or a symbol.

Choice b - Range of real constants expressed in exponential form is 3.4e38 to 3.3e38. Choice c - + is a character constant. Choice d - Union is a primary constant. [2] If a is a float variable, a = 5/2 ; will return a value Choice a 2.5 Choice b 3 Choice c 2 Choice d 0 [3] Which of the following statement is false? Choice a An integer constant must have at least one digit. Choice b No commas or blanks are allowed within an integer constant. Choice c The allowable range for integer constant is 32767 to +32767. Choice d Negative integer constant is allowed in C. [4] Which of the following is not a keyword? Choice a auto Choice b if Choice c default Choice d elseif [5] Which of the following statement is correct? Choice a Linux is written in C. Choice b Taking speed and time into consideration fast gaming framework is developed in C. Choice c C is a programming language which develops device driver programs. Choice d All of the above. [6] Which of the following translates a C language program to machine language program? Choice a Editor Choice b Compiler Choice c Preprocessor Choice d Linker

[7] Which of the following statement is incorrect? Choice a The type declaration statement is written at the beginning of main( ) function. Choice b The order of defining variables is always important. Choice c The variables can be initialized while declaring. Choice d None of the above [8] Type declaration instructions are used to declare Choice a Type of constants. Choice b Keyword. Choice c Type of variables. Choice d Type of arithmetic to be performed. [9] Which of the following part of integrated development environment is used to include different files in one file? Choice a Editor Choice b Compiler Choice c Preprocessor Choice d Linker [10] Which of the following statement is incorrect? Choice a float a = 1.99 + 2.4 + 1.45 ; Choice b float a = 1.65, b = a + 2.2 ; Choice c float x = y + 2.34, y = 1.42 ; Choice d int a, b, c, d ; a = b = c = 10 ; [11] Which of the following declaration is incorrect? Choice a int a ; a=5; Choice b int a = 5 ; Choice c int a = b= c = 5 ; Choice d int a, b, c ; a=b=c=5; [12] Which of the following statement is incorrect? Choice a An arithmetic instruction is often used for storing character constants in character variable. Choice b Arithmetic operations on chars are permissible. Choice c Arithmetic operators should be written explicitly. Choice d Operator for performing exponentiation is present.

[13] Which of the following is not a type of arithmetic statement? Choice a Integer mode arithmetic statement. Choice b Real mode arithmetic statement. Choice c Character mode arithmetic statement. Choice d Mixed mode arithmetic statement. [14] Which of the following is not an arithmetic operator? Choice a + Choice b * Choice c = Choice d / [15] How many variables C allows on left side of =? Choice a 1 Choice b 2 Choice c 3 Choice d 4 [16] Which of the following statement is correct? Choice a Assignment operator enjoys highest priority. Choice b The operations within outermost parentheses are performed first. Choice c In C, BODMAS rule is applicable for evaluation of arithmetic expressions. Choice d The priority or precedence in which the operations in an arithmetic statement are performed is called the hierarchy of operations. [17] The priority or precedence in which the operations in an arithmetic statement are performed is called Choice a Arithmetic instruction. Choice b Control instruction. Choice c Hierarchy. Choice d Associativity. [18] Which of the following statement is correct? Choice a When an expression contains two operators of equal priority the tie between them is settled using the hierarchy of the operators. Choice b Left to Right associativity means that the left operand must be ambiguous. Choice c In case of Right to Left associativity the right operand must not be involved in evaluation of any other sub-expression.

Choice d

None of the above

[19] Which of the following operator has the highest priority? Choice a Assignment operator. Choice b Addition operator. Choice c Subtraction operator. Choice d Multiplication. [20] Which of the following operator has the lowest priority? Choice a Assignment operator. Choice b Addition operator. Choice c Modular division operator. Choice d Multiplication operator. [21] Which of the following keyword cannot be used within the switch statement? Choice a case Choice b break Choice c continue Choice d None of the above [22] Consider following code snippet: void main( ) { int a, b ; a=-3--3; b=-3--(-3); printf ( a = %d b = %d, a, b ) ; } What would be the output of above code? Choice a 0 6 Choice b -6 0 Choice c 0 0 Choice d -6 -6 [23] Consider following code snippet: void main( ) { printf ( tt \t tt\t ) ; print ( tt /t tt/t ) ; }

What would be the output of above code? Choice a tt tt tt tt Choice b tt tt tt/t tt/t Choice c tt tt tt tt Choice d tt \t tt\t tt /t tt/t [24] Consider following code snippet: void main( ) { printf ( "Learning\C\is\great\enjoyment." ) ; } What would be the output of above code? Choice a Learning\C\is\great\enjoyment. Choice b Learning C is great enjoyment. Choice c LearningCisgreatenjoyment. Choice d Learning C is great enjoyment. [25] Consider following code snippet: void main( ) { float x = 1, y = 1, z ; printf ( %d, z = ( x / y ) ) ; } What would be the output of above code? Choice a 0 Choice b 1 Choice c 1.000000 Choice d Garbage value [26] Consider following code snippet: void main( ) { int i = 2, j ; float f = 3.0 ; char ch = '*' ; //add statement here } Which of the following statement is to be added to get the output 254 if the ASCII value of * is 42?

Choice a printf ( "%d", j = i + 2 * * ch ) ; Choice b printf ( "%d", j = i + 2 * f * ch ) ; Choice c printf ( "%d", j = 2 * f * ch ) ; Choice d printf ( "%d", j = i + 2 f * ch ) ; [27] Consider following code snippet: extern int i ; Which of the following statement is correct about above code? Choice a It is a declaration. Choice b It is a definition. Choice c It is declaration as well as definition. Choice d It is neither declaration nor definition. [28] Which of the following code snippet will give output as 10? Choice a void main( ) { int i = 10 ; printf ( "%d", i ) ; } Choice b void main( ) { printf ( "%d", 10 ) ; } Choice c void main( ) { printf ( "%d", i = 10 ) ; } Choice d All of the above.

[29] Consider following code snippet: void main( ) {

int a, b, c, d ; printf ( %d, d = a + 2 b c ) ; } Which of the following statement is correct about the above code? Choice a Choice b Choice c Choice d Error: Lvalue required. Error: Rvalue required. Error: Function call missing. The code generates runtime exception.

You might also like