aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Programs in C
  • void main() { int x; x=sizeof(!7.8); printf("%d",x); }
Multiple choice

void main() { int x; x=sizeof(!7.8); printf("%d",x); }

  1. 4

  2. 2

  3. 8

  4. 1

  5. 10

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

! is negation operator and it returns either integer 0 or 1. So, !7.8 = 0, and 0 is integer number and size of integer data type=2.

Keep practicing — related questions

  • What is the output of the following code snippet ?? void main() { printf("%d", sizeof(2.0)); }
  • void main() { printf("%d"t, sizeof(7.5)); printf("%d"t, sizeof(80000)); printf("%d"t, sizeof('B')); }. Whic...
  • void main() { print("%d%d%d", sizeof(4.14), sizeof(4.14f), sizeof(4.14L)); }
  • void main() { int i=5; i+=i*=i-=i/i; printf("%d",i); }
  • main(){ int x=5; printf("%d %d %d\n", x,x<<2,x=x>>2); }
  • What will be the output of the following set of code after execution? void main() { printf(“%d %d”,sizeof('...
  • 3) void main() { int x=10; (x<0) ? (int a = 100) : (int a=1000); printf(“%d”,a); }
  • 1)main() { printf(“%x”,-1<<4); }
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy