aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Computer Science and Information Technology Fundamentals
  • What is the output of the given C program? main() { unsig...
Multiple choice

What is the output of the given C program?

main()

{

  unsigned int m=32;

   printf("%x",~m);

}

  1. ddfd

  2. ffdf

  3. ffff

  4. 0030

  5. 4563

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

m = (32)10 = (0000 0000 0010 0000)2~m = (1111 1111 1101 1111)2 = ffdf

Keep practicing — related questions

  • What is the output of the following 'C' program? main() { printf(“ %x”,-1 >>4); }
  • What would be the output of the following program? main() { unsigned char i = 0x80; printf("\n%d", i<<1); }
  • What is the output of the given program? int main() { int x = 24; int y = 42; printf("%d",(~x) | (~y) ); }
  • What will be the output of the following function? main() { printf(%x,-1<<4); }
  • What will be the output of the following set of codes after execution? void main() { int m=32769; unsigned ...
  • what is the output of the following programmain(){ int x; printf(“%d”,x); }
  • What is the output of the given C program? int main() {int i = (1048576>>8>>3>>8>>3) + + - + (1024<<8<<3>>8...
  • What is the output of the given C program? int main(){int i = (1048576>>8>>3>>8>>3) + + - + (1024<<8<<3>>8>...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy