In switch statement, one of the optional key word is ________.

A. break B. two C. one
D. static E. structure F. global
G. indirection H. type casting I. auto
J. free K. array L. fseek
M. continue N. fprintf O. malloc
P. & Q. new R. fscanf

4.1 In switch statement, one of the optional key word is ________.
4.2 ________ is used to construct user defined data type using the existing ones.
4.3 ________ is used to skip body of the loop once.
4.4 To convert one data type into another for the evaluation purpose is called ________.
4.5 In for loop, initialization is done ________ time(s).
4.6 ________ operator is used to access the value of a variable using pointer.
4.7 ________ variable can be accessed by all the functions in the program.
4.8 ________ uses a single name to represent a collection of items of same type.
4.9 Using ________ function, we can write data to file.
4.10 ________ function is used to allocate memory at run time.

There is only one ternary operator in ‘C’ which is Conditional operator.

Each statement below is either TRUE or FALSE. Choose the most appropriate one
and ENTER in the “tear-off” sheet attached to the question paper, following
instructions therein.

2.1 By default, return type of any user-defined function is void.
2.2 In else…if ladder, the else statement at last is optional.
2.3 There must be only one main( ) function in a program.
2.4 There is only one ternary operator in ‘C’ which is Conditional operator.
2.5 int a[ ]={4}; this statement allocates 4 bytes of memory.
2.6 Float_int (float, float); is an invalid function prototype.
2.7 printf( ) is a user-defined function declared in stdio.h file.
2.8 When an array is declared, name of array works as a constant pointer to base address.
2.9 Every string ends with character ‘\&’.
2.10 If file can not be opened, fopen( ) returns Null pointer.

The keyword typedef is used to

1.9 The keyword typedef is used to
A) create a type of function
B) define the type of function
C) define the type of a variable
D) create a new data type name

Which is the correct option for the following code?

1.7 Which is the correct option for the following code?
main() { char *str1="hello", *str2="hello";
if(str1==str2)
printf("equal");
else
printf("unequal"); }
A) Output is equal
B) Syntax error
C) Error because two pointers cannot be compared
D) Output is unequal

What will be the output of the following code?

1.6 What will be the output of the following code?
main() { int a,b,c;
a=1,b=10,c=2;
for( ;c<3;c++);
for( ;a<9,b>6;a++,b--)
printf(“%d”,c);
}
A) Infinite 2 2 2 ……
B) 3 3 3 3
C) 2 2 2 2
D) Infinite times 4 4 4 …

What is the effect of the following code:

1.5 What is the effect of the following code:
main() { int a[4] = {1,5};
printf(“%d”, a[3]); }
A) 0
B) Syntax error because of improper initialization
C) 5
D) Syntax error because of invalid index

To print whether the number is odd or even, choose the correct option.

1.4 To print whether the number is odd or even, choose the correct option.
A) (a/2==0)?pr int f ( “Odd” ) ; :pr int f ( “Even” ) ;
B) (a%2==0)?pr int f ( “Odd” ) :pr int f ( “Even” ) ;
C) (a%2==1)?pr int f ( “Odd” ) :pr int f ( “Even” ) ;
D) (a/2==1)?pr int f ( “Even” ) :pr int f ( “Odd” ) ;

Which of the following is true for break and continue statements.

1.3 Which of the following is true for break and continue statements.
A) break transfers control out of loop, continue bypasses the remaining statements of loop.
B) break bypasses the remaining statements of loop, continue transfers control out of loop
C) both have same function
D) none of the above