wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

MCA-Quiz-2

Total questions: 11

Worksheet time: 9mins

Name
Class
Date
1.

What is the output of the C program?

int main()

{

int a = -25%-10;

int b = -25%10;

int c = 25%-10;

printf("%d %d %d", a, b, c);

}

a)

5 -5 -5

b)

5 -5 5

c)

-5 -5 5

d)

5 5 5

2.

What is the output of C Program?

int main()

{

int a=0;

a = printf("41");

printf("%d",a);

return 0;

}

a)

compiler error

b)

2

c)

41

d)

412

3.

What is the output of the C Program.?

int main()

{

if( 4 > 5 );

{

printf("Hello\t");

printf("Hi");

}

printf("Yes");

return 0;

}

a)

Hello Hi

b)

Yes

c)

Hello Hi Yes

d)

Compiler Error

4.

What is the output of C Program.?

int main()

{

int a=9;

if(a=8)

{

printf("Hello\t");

}

printf("Hi");


return 0;

}

a)

Hello

b)

Hi

c)

Hello Hi

d)

Compiler Error

5.

What is the output of C Program.?

int main()

{

int a=9, b;

b = (a==9) ? (printf("Hello");printf("T")) : (printf("F"));

return 0;

}

a)

HelloT

b)

F

c)

Compiler Error

d)

Runtime Error

6.

What is the output of C Program.?

int main()

{

int a=5,b=6;

int c= (a>b) && (a == --b) || (++a<b);

printf("a= %d b=%d c=%d",a,b,c);

return 0;

}

a)

a= 5 b=5 c=0

b)

a= 6 b=5 c=0

c)

a= 6 b=6 c=0

d)

a= 5 b=5 c=1

7.

What is the output of C Program.?

int main()

{

int m,i=0,j=1,k=2;

int m= i++ || j++ ||k++;

printf("m=%d i= %d j=%d k=%d",m,i,j,k);

return 0;

}

a)

m=1 i=1 j=1 k=2

b)

m=1 i=1 j=2 k=2

c)

m=1 i=1 j=2 k=3

d)

m=1 i=0 j=1 k=2

8.

What is the output of C Program? where size of int is 2 bytes.

int main()

{

int i=3,j;

j= sizeof(++i);

printf("i=%d j= %d",i,j);

return 0;

}

a)

i=4 j=2

b)

i=3 j=2

c)

behavior is undefined

d)

compiler Error

9.

Which Operator has the lowest priority?

a)

++

b)

+

c)

%

d)

||

e)

&&

10.

What is the output of C Program? where size of int is 2 bytes.

int main()

{

int a=2,b=3,c=0,d=8;

if(a,b,d,c)

{

printf("Hello");

}

printf("Hi");

return 0;

}

a)

Hello

b)

Hi

c)

HelloHi

d)

None of these

11.

what will be the output?

int main()

{

printf("%x",-1<<4);

return 0;

}

a)

fff1

b)

ffff

c)

fff0

d)

fff2