Вы находитесь на странице: 1из 9

[1] Which of the following statement is false? Choice a An integer constant must have at least one digit.

No commas or blanks are allowed within an integer constant. The allowable range for integer constant is 32767 to +32767. Negative integer constant is allowed in C. [2] Which of the following is not a keyword? Choice a Choice b Choice c Choice d 3] Which of the following statement is correct? Choice a A character constant in C will never be a digit or a symbol. Range of real constants expressed in exponential form is 3.4e38 to 3.3e38. auto if default elseif

Choice b

Choice c

Choice d

Choice b

Choice c Choice d

+ is a character constant. Union is a primary constant.

[4]

If a is a float variable, a = 5/2 ; will return a value


Choice a Choice b Choice c Choice d [4] If a is a float variable, a = 5/2 ; will return a value Choice a Choice b Choice c Choice d 2.5 3 2 0 [6] Which of the following statement is incorrect? Choice a Choice b Choice c Choice d The type declaration statement is written at the beginning of main( ) function. The order of defining variables is always important. The variables can be initialized while declaring. None of the above 2.5 3 2 0

[7] Which of the following part of integrated development environment is used to include different files in one file? Choice a Choice b Editor Compiler

Choice c Choice d

Preprocessor Linker

[8] Which of the following statement is incorrect? Choice a Choice b Choice c Choice d float a = 1.99 + 2.4 + 1.45 ; float a = 1.65, b = a + 2.2 ; float x = y + 2.34, y = 1.42 ; int a, b, c, d ; a = b = c = 10 ;

[9] Which of the following translates a C language program to machine language program? Choice a Choice b Choice c Choice d Editor Compiler Preprocessor Linker

[10] Type declaration instructions are used to declare Choice a Choice b Choice c Choice d Type of constants. Keyword. Type of variables. Type of arithmetic to be performed.

[11] Which of the following declaration is incorrect? Choice a Choice b Choice c Choice d int a ; a=5; int a = 5 ; int a = b= c = 5 ; 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 Choice c Choice d

Arithmetic operations on <B>chars</B> are permissible. Arithmetic operators should be written explicitly. Operator for performing exponentiation is present.

[13] Which of the following is not a type of arithmetic statement? Choice a Choice b Choice c Choice d Integer mode arithmetic statement. Real mode arithmetic statement. Character mode arithmetic statement. Mixed mode arithmetic statement.

[14] Which of the following will cause error in code? Choice a Choice b Choice c Choice d i=a+b; x*y=z; avg = ( a + b + c + num ) / 4 ; a = b = c= d = 4 ;

[15]

Which of the following is not an arithmetic operator?


Choice a Choice b Choice c Choice d + * = /

[16] How many variables C allows on left side of =? Choice a Choice b Choice c 1 2 3

Choice d

[17] Which of the following operator has the highest priority? Choice a Choice b Choice c Choice d Assignment operator. Addition operator. Subtraction operator. Multiplication.

[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. Left to Right associativity means that the left operand must be ambiguous. In case of Right to Left associativity the right operand must not be involved in evaluation of any other subexpression. None of the above

Choice b Choice c

Choice d

[19] Which of the following statement is correct? Choice a Choice b Choice c Choice d Assignment operator enjoys highest priority. The operations within outermost parentheses are performed first. In C, BODMAS rule is applicable for evaluation of arithmetic expressions. The priority or precedence in which the operations in an arithmetic statement are performed is called the hierarchy of operations.

[20] The priority or precedence in which the operations in an arithmetic statement are performed is called Choice a Choice b Choice c Choice d Arithmetic instruction. Control instruction. Hierarchy. Associativity.

[21] Which of the following operator has the lowest priority? Choice a Choice b Choice c Choice d Assignment operator. Addition operator. Modular division operator. Multiplication operator.

[22] Which of the following keyword cannot be used within the switch statement? Choice a Choice b Choice c Choice d [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 Choice b Choice c Choice d tt tt tt tt tt tt tt tt tt/t tt/t tt tt case break continue None of the above

tt \t tt\t tt /t tt/t [24] 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 Choice b Choice c Choice d

0 6 -6 0 00 -6 -6

[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 Choice b Choice c Choice d 0 1 1.000000 Garbage value

[26] Consider following code snippet: void main( ) { printf ( "Learning\C\is\great\enjoyment." ) ; } What would be the output of above code? Choice a Choice b Choice c Choice d Learning\C\is\great\enjoyment. Learning C is great enjoyment. LearningCisgreatenjoyment. Learning C is great enjoyment.

[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 Choice b Choice c Choice d printf ( "%d", j = i + 2 * * ch ) ; printf ( "%d", j = i + 2 * f * ch ) ; printf ( "%d", j = 2 * f * ch ) ; printf ( "%d", j = i + 2 f * ch ) ;

[28] Consider following code snippet: extern int i ; Which of the following statement is correct about above code? Choice a Choice b Choice c Choice d It is a declaration. It is a definition. It is declaration as well as definition. It is neither declaration nor definition.

[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 Choice b Choice c Error: Function call missing. Error: Lvalue required. Error: Rvalue required.

Choice d

The code runs successfully.

[30] Consider following code snippet: void main( ) { int a = 5, b = 2, c ; a+b=c; printf ( %d, 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: Undeclared identifier c. The code runs successfully.

Вам также может понравиться