aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C Programming - 2
  • Consider the declaration. int a = 5, *b = &a; printf(...
Multiple choice

Consider the declaration. int a = 5, b = &a; printf(“%d”, a*b); prints

  1. 25

  2. garbage

  3. 0

  4. error message

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

a is 5, b is a pointer to a. *b is the value at the address b, which is 5. So a * *b is 5 * 5 = 25.

Keep practicing — related questions

  • Consider the following declaration. int a = 5, *b = &a; printf(“%d”, a*b);The above program prints
  • what is the output? int a = 400; void main() { int b; b=(400 * 400)/ a ; printf("%d",b); }
  • The statement printf (“%d”, sizeof(“”)); prints
  • void main() { int a= 100; void *j= &a; int *k= j; printf("%u", *k); }
  • What will be the output of the following: void main() { register int a; printf("%d",a); }
  • Print the output of this program main() { int k = 5; if (++k < 5 && k++/5 || ++k <= 8); printf("%d\n", k); }
  • main() { extern i; printf("%d",i); { int i=20; printf("%d",i); } }
  • What is the output ? main() { int x=2000, *p, y = 200; p = &y; x = x/*p; printf("%d", x); }
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy