aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C Programming - 2
  • The following program results in main() { printf(“%u”, ma...
Multiple choice

The following program results in main() { printf(“%u”, main); } 

  1. printing of a garbage number

  2. an execution error

  3. printing of starting address of the function main

  4. an infinite loop

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

In C, the name of a function used in an expression decays to a pointer to that function, which is its starting address.

Keep practicing — related questions

  • What will be the output of the following set of codes after execution? void main() { printf(“%d”,sizeof(' '...
  • What will be the output of the following function? main() { int a[10]; printf(%d,*a+1-*a+3); }
  • What will be the output of the given program? int main() { printf(Hello World\\n); main(); return 0; }
  • What will be the output of the following: void main() { register int a; printf("%d",a); }
  • What will be the output of the following set of code after execution? void main() { printf(“%c %d”,'C','C'); }
  • 1)main() { int i = 0; for( ; i++ ; printf(“%d”,i)); printf(“%d”,i); }
  • void main() { int a= 100; void *j= &a; int *k= j; printf("%u", *k); }
  • Print the output of this program main() { int k = 5; if (++k < 5 && k++/5 || ++k <= 8); printf("%d\n", k); }
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy