Online GK Series

This site is dedicated to the aspirants of competitive exams SSC, UPSC, Railways, Postal Assistants, Bank, GATE and NET

Q.

What is the output of the following code segment(assuming sizeof(int) returns 4)?

	int i=0x1 << sizeof(int)*8-1;
	printf("\n%x",i);
	i=i>>sizeof(int)*8-1;
	printf("%d",i);
	
A 0x8000000-1
B 80000000-1
C -1 0x0000000
D -1 0000000
Answer & Explanation
Option: [B]

mcq on c programming c basic 03

Computer Science Books

Your Valuable Comments Please...

Please Like Us
Brand