aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C Data Types, Variables & Storage Classes
  • What will be the output of the following C code? void mai...
Multiple choice

What will be the output of the following C code? void main() { double t=9.0,c=78.50; float Res; Res = (t+c)/8; printf(%.4f, Res); }

  1. 10

  2. 11

  3. 10.9000

  4. 10.9375

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

Res = (t+c)/8 = (9.0 + 78.50)/8 = 87.50/8 = 10.937500 Due to '%.4f', it will print 10.9375.

Keep practicing — related questions

  • What will be the output of the following program: void main() { float val=2.; printf("%.2",val); }
  • What will be the output of following program code? #include<stdio.h> main() { int k; float j; j=9.0/2; k=9/...
  • output?? int main() { printf("%0.4f",3.414164); return 0; }
  • What will be the output of the following program : void main() { printf("%f",123.); }
  • What will be the output of the following: void main() { float a=0.7; if(a<0.7) printf("c++"); else printf("...
  • What would be the output of the following C program? int n=2, m=3, k; k = (float)m/(float)n; printf(k=%0.5d...
  • What would be the value of the following C code? float a; a = floor(6.523); printf(!!!^!!!a = 0.2f!!!^!!!,a);
  • What will be the output of the following C code? void main() { int t; char *pc=(char *)0; float *pf=(float ...
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