C Data Types 2 Questions and Answers

Practice Mode
Showing 10 of 159 questions
Q131
Find the output. void main ( ) { char c=65; c=(!=c); printf("%d",c); }
  • A 0
  • B 65
  • C 2
  • D Compilation error
Answer: Option D
Q132
Find the output. void main ( ) { char not=65; not=not + (not =!not); printf("%d',not); }
  • A 0
  • B 65
  • C 1
  • D 66
Answer: Option A
Q133
Find the output. void main ( ) { char p[ ]="%d\n"; p[1]='c'; printf ("%s", p, 65); }
  • A %d
  • B %c
  • C A
  • D %s
Answer: Option B
Q134
Find the output void main ( ) { unsigned int i; for (i=1; i>-2; i--) printf("a"); }
  • A aaa
  • B aa
  • C No output
  • D Compilation error
Answer: Option C
Q135
Find the output void main ( ) { unsigned int i; for (i=1; i>-2; i--) printf ("a"); }
  • A aaa
  • B aa
  • C No output
  • D Compilation error
Answer: Option C
Q136
Find the output void main ( ) { signed char i=1; for (;i>0;i++); printf ("%d",i); }
  • A 127
  • B 128
  • C -128
  • D infinite loop
Answer: Option C
Q137
Find the output. #define sizeof (int) 3 #define float int void main ( ) { float a; if(a=sizeof (int) / sizeof (float)) if (a==1.00000) printf("Testing"); printf("OK"); }
  • A No output
  • B OK
  • C Testing
  • D Testing OK
Answer: Option D
Q138
Find the output void main( ) int a=256; char *p=&a; *++p=2; printf("%d", a); }
  • A 512
  • B 258
  • C Compilation error
  • D None of these
Answer: Option A
Q139
Find the output int main ( ) { float a=12.5; printf("%f\n",a); printf  ('%f", *(int *) &a); return 0;
  • A 12.500000 0.000000
  • B 12.500000 12.500000
  • C 0.000000 12.500000
  • D None of these
Answer: Option A
Q140
Find the output void main ( ) { char ch ='A'; ch=-100-91; printf("%c", ch); }
  • A f
  • B A
  • C a
  • D None of these
Answer: Option B
Questions and Answers for Competitive Exams Various Entrance Test