You are on page 1of 8

[30] 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 x = 1, y = 1 ; x+y=2; printf ( %d, ( x + y ) ) ; } Which of the following statement is correct about the above code? Choice a Error: Function call missing. Choice b Error: Lvalue required. Choice c Error: Rvalue required. Choice d The code runs successfully. [28] 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. [27] 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 ) ; 26] 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 [25] 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 00 Choice d -6 -6 [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. [23] 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 22] 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 [21] 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.

[20] Which of the following operator has the highest priority? Choice a Assignment operator. Choice b Addition operator. Choice c Subtraction operator. Choice d Multiplication. 19] 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. 18] 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. [17] 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 [16] How many variables C allows on left side of =? Choice a 1 Choice b 2 Choice c 3 Choice d 4 [15] 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 <B>chars</B> are permissible. Choice c Arithmetic operators should be written explicitly. Choice d Operator for performing exponentiation is present. ] [14] 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. [13] Which of the following is not an arithmetic operator? Choice a + Choice b

* Choice c = Choice d / [12] Which of the following will cause error in code? Choice a i=a+b; Choice b x*y=z; Choice c avg = ( a + b + c + num ) / 4 ; Choice d a = b = c= d = 4 ; [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; [10] 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 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 8] 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 ; [7] 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 6] 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.

You might also like