C Data Types 2 Questions and Answers

Practice Mode
Showing 10 of 159 questions
Q121
The number of bytes of storage occupied by short, int and long int are
  • A 2, 2 and 4
  • B 2, 4 and 4
  • C 4, 4 and 4
  • D Machine dependent
Answer: Option D
Q122
Find the output void main ( ) { int a; char b; float c; printf ("%d", sizeof (a+sizeof(b+c)))); }
  • A 2
  • B 1
  • C 4
  • D Compilation error
Answer: Option A
Q123
Find the output int main (void) { int x=256; if(*(char *) &x = =255 { printf(Little Endian\n"); } return 0; }
  • A Big Endian
  • B Little Endian
  • C Compilation error
  • D None of these
Answer: Option A
Q124
Find the output. void main ( ) [ printf ("%d",~1^~0); }
  • A -2
  • B 1
  • C 0
  • D -1
Answer: Option B
Q125
Find the output. int main ( ) { unsigned val=0xabcd; if(va>>16|val<<16) { printf ("success")); } return exit (0); printf ("Failure"); }
  • A No output
  • B Success
  • C Failure
  • D SuccessFailure
Answer: Option A
Q126
Find the output. void main ( ) { int x=4; printf("%d",printf ("%d%d", x+1, x)); }
  • A 5 4 5
  • B 4 4 5
  • C 5 4 2
  • D 4 4 2
Answer: Option C
Q127
Find the output. void main ( ) { int x=-5u; int y=5; y=y>x?y/x:x/y; printf("%u", y); }
  • A 13106
  • B -1
  • C 65535
  • D 5
Answer: Option C
Q128
Find the output. void main ( ) { int i=5; prntf ("%dcef"+1, i) +1; }
  • A 15ceg
  • B %dceg
  • C dceg
  • D ceg
Answer: Option C
Q129
Find the output. void main ( ) { unsigned val=0xfff; if(~val) printer ("%d", val); printf ("%d", ~val); }
  • A -1 0
  • B -1
  • C 0
  • D Compilation error
Answer: Option C
Q130
When a tab key is pressed how much memory is reserved for it?
  • A 2 byte
  • B 8 bytes
  • C Depends on the memory model
  • D None of these
Answer: Option A
Questions and Answers for Competitive Exams Various Entrance Test