You are on page 1of 2

1) Using _______ statement is how you test for a specific condition.

a. Select
b. If
c. Switch
d. For
2) C programming : State true of false.

It is possible to pass a structure variable to a function either by value or by


address.

a. True
b. False
3) C programming : Suppose that x is a one dimensional array, then choose the
correct answer regarding array.

a. *(x + n) is same as &x[n]


b. *&x[n] is same as x + n
c. *(x + n) is same as x[n] +1
d. *(x + n) is same as *x[n]
4) C programming : If you want to store dissimilar data together, then which type
you will use?

a. array
b. structure
c. stack
d. None of the above.
5) C programming : Trace the output

int main()
{
int a=12,b=39;
printf ("%d",a&b);
return 0;
}

a. 468
b. 0
c. 4
d. None of the above.
6) C programming : Trace the output.

void main()
{
int i=2,j=2;
while(i+1?--i:j++)
printf("%d",i);
}

a. 1
b. 2
c. ERROR
d. None of the above.
7) C programming : Match the following:

a. calloc( ) ------- i. Frees previouslyallocated space.


b. free( ) ----------- ii. Modifiespreviouslyallocated space.
c. malloc( ) ------- iii. Allocates spacefor array.
d. realloc( ) ------- iv. Allocatesrequested size ofspace.

a. a-iii, b-i, c –iv, d -ii


b. a-iii, b-ii, c –i, d -iv
c. a-iii, b-iv, c –i, d -ii
d. a-iv, b-ii, c –iii, d -i
8) Identify the wrong syntax
(C programming)

a. typedef struct { member declaration; } NAME; NAME V1, V2;


b. typedef struct tag{ member declaration; } NAME; NAME V1, V2;
c. typedef struct { member declaration; } NAME; NAME V1, V2;
d. typedef struct tag { member declaration; } NAME; NAME V1, V2;
9) What is the default return-type of getchar()? (C programming)

a. char
b. int
c. char *
d. Reading character doesn't require a return-type
10) Which of the following cannot be checked in a switch-case statement?
(C programming)

a. Character
b. Integer
c. Float
d. enum

You might also like