C MCQ

1.Is it possible to run the  program without the main( ) function in C ?

a.true

b.false

Answer:b 

2.By which operator,we can find out the size of data type.

sizeof( )

b.size( )

c.macro

d.None of these

Answer:a

3.What would be the output of below code

void main( )
{
float a=1.2;
Double b=1.2;
if(a==b)
{
printf(“suman kumar”);
}
else
{
printf(“suman dil”);
}
}

a.suman kumar

b.suman dil

c.compile time error

d.none of these

Answer:b

4.What would be the output of the below code

{
Int x=3;
printf(“%d%d%d”,x,x++,x++);
}

a.3 4 5

b.3 3 4

c.3 4 6

d.None of these

Answer:b

5.What would be the output of the below code ?

void main( )
{
for(; ;)
{
}
}

a.1 times

b.infinite

c.no output

d.None of these

Answer:a

6.What would be the output of the below code ?

void main( )
{
Char *p;
p=”suman”;
printf(“%c”.*&*p);
}

a.suman

b.s

c.sum

d.compile time error

Answer:b

7.C is a ……. language

a.object-oriented

b.structured 

c.object-based

d.None of these

Answer:b

8.What would be the output of the below code ?

void main( )
{
Int i=2,j=5;
printf(“%d”,++i+j--);
}

a.7

b.8

c.9

d.6

Answer:b

9.What would be the output of the below code ?

void main( )
{
Char s[ ]=”sumandil”;
Int i=strlen(s);
printf(“%d”,i--);
}

a.7

b.8

c.9

d.6

Answer:a

10. which of the following is not a storage specifier in C

a.static

b.dynamic

c.extern

d.register

Answer:b

11.How many loops in C language ?

a.4

b.5

c.3

d.2

Answer:c

12.What is the value of EOF ?

a.0

b.-1

c.1

d.None of these

Answer:b

13.if two strings are equal then which value returns

a.1

b.true

c.0

d.None of these

Answer:c

14.Which header file should be used to use the calloc( ) and malloc( ) functions.

a.string.h

b.stdlib.h

c.memory.h

d.None of these

Answer: b

15.What would be the output of the below code ?

void main( )
{
Int arr [ ]={1,2,3,4,5};
printf(“%d”,arr[5]);
}

a.5

b.6

c.garbage value

d.None of these

Answer:c

16.What would be the output of the below code ?

void main( )
{
Int i=9;
Int sum=i/5;
printf(“%d”,sum);
}

a.2

b.1

c.4

d.5

Answer:a

17.Who is the father of C language ?

a.games gosling

b.dennis ritchie

c.bill gates

d.None of these

Answer:b

18.what would be the output of the below code ?

void main( )
{
Int i=10;’
for(int i=10;i<=10;i++)
{
printf(“hello”);
}
}

a.10 times hello

b.hello

c.compile time error

d.none of these

Answer:b

19.What do you mean by pointer ?

a.variable which contains address of another variable

b.variable which contains value of another variable

c.data types which contains int/float/double etc type

d.None of these

Answer:a

20.How pointer declared in C language ?

a.int *p

b.int p*

c.&p

d.None of these

Answer:b