aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C Programs (GATE)
  • Find the output of the following C program: main(){int i=...
Multiple choice

Find the output of the following C program:

main(){int i=2;printf(%d %d,++i,++i);}

  1. 3 4

  2. 4 3

  3. 4 4

  4. Output may vary from compiler to compiler

  5. None of these

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

Value of i = 2, ++i = 3 and ++i = 4.

Keep practicing — related questions

  • Find the output of this program. main() { int i=5; printf(“%d”,i=++i ==6); }
  • Find the output of this program. main() { int i=5; printf(“%d”,i=++i ==6); }
  • Find the output of the following C program: main(){int i=0;while(++i<=10) printf(%d, i);}
  • Find the output of the following C program: main(){extern int i;i=20;printf(%d,sizeof(i));}
  • Find the output of this program. main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }
  • Find the output of this program. main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }
  • Find the output of the following C program: Main(){int i;For(i=1;i <=10;i ++){Printf(%d ”,i);i=i+1;}}
  • Find the output of this program. main() { int a[10]; printf("%d",*a+1-*a+3) ; }
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Programming Output Evaluation (1721 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy