aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C Programming - 2
  • What would be the output of the follwing program? sum = 0...
Multiple choice

What would be the output of the follwing program? sum = 0; for(i=1;i<10;i++) if(i%2==0) sum +=i; printf(“%d”, sum);

  1. 45

  2. 0

  3. 40

  4. 30

Reveal answer Fill a bubble to check yourself
D Correct answer

Keep practicing — related questions

  • What will be the output of the following program : void main() { int i, n =10; for (i=1; i
  • What will be the output of the following program : void main() { printf("%d",!(100==100)+1); }
  • What is the output?int i = 3;if (!i) i++; i++;if (i==3) i+=2; i+=2;printf("%d\n", i);
  • void main() { int i,n,sum=0; scanf(“%d”,&n); for(i=0;i<=n;i++) sum=sum+i; printf(“%d”,sum); } The above pro...
  • What will be the output of the following: void main() { int i; for(i=1;i<=4;i++) { printf("%d",i); continue...
  • The output of the following program will be main() { int a = 1, b=2, c=3; printf(“%d”, a+=(a+=3,5,a)); }
  • What would be the output of the following? void main() { int a=10,b; b=a++ + ++a; printf("%d %d %d %d",b,a+...
  • Find the output of the following C program: Main(){int i;For(i=1;i <=10;i ++){Printf(%d ”,i);i=i+1;}}
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