aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C Programming Fundamentals
  • What is the right coding to find the formatted output of ...
Multiple choice

What is the right coding to find the formatted output of float value upto 4 decimal points? float a=23.76548;

  1. printf ( "% f ",a);

  2. printf ( "% 4" , a );

  3. printf ( "%2.4" f ;a);

  4. printf ( "% i" ,a);

  5. printf ( "%d" ;a);

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

This is the correct format of the output in which it will consider only four decimal points  after the number.

Keep practicing — related questions

  • If the declaration is float x = 123.456, then the statement printf(“%7f %7.1f “,x,x) will print
  • What will be the output of the following C code? void main() { double t=9.0,c=78.50; float Res; Res = (t+c)...
  • 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 following program code? #include<stdio.h> main() { int k; float j; j=9.0/2; k=9/...
  • What will be the output of the following program: void main() { float val=2.; printf("%.2",val); }
  • Which one of the following printf() format specifiers indicates to print a double value in decimal notation...
  • output?? int main() { printf("%0.4f",3.414164); return 0; }
  • What will be the output of the following: void main() { float a=0.7; if(a<0.7) printf("c++"); else printf("...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy