aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Java and C Programming Fundamentals
  • Consider the following C statement. int a = 5; printf(a =...
Multiple choice

Consider the following C statement. int a = 5; printf(a = %usizeof(a)); What would be the output of the above C code?

  1. a = 1

  2. a = garbage value

  3. a = 2

  4. Compiler error

  5. None of these

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

This is the correct option as the integer value occupies 2 bytes in the memory for storage.

Keep practicing — related questions

  • What will be the output of the following set of codes after execution? void main() { printf(“%d”,sizeof(' '...
  • Consider the following C statement: int i = 5, n = 2, z;z = (i! =n) || i>n && n; printf(z = %d,z); What wou...
  • The statement printf (“%d”, sizeof(“”)); prints
  • what is the output? int a = 400; void main() { int b; b=(400 * 400)/ a ; printf("%d",b); }
  • 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 C++ code? #include <stdio.h> int main() { int a,b; a = (b=2,b+3); print...
  • Consider the declaration. int a = 5, *b = &a; printf(“%d”, a**b); prints
  • What will be the output of the following set of code after execution? void main() { printf(“%c %d”,'C','C'); }
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy