Answer to Question #220691 in C++ for Saranya

Question #220691
write a program to initialize the value as 5.800000 & display the value on the monitor as 5.8000?
1
Expert's answer
2021-07-27T16:24:01-0400
#include <iostream>
#include<iomanip>
using namespace std;


int main()
{
    float x=5.800000;
    cout<< fixed << setprecision(4)<<x;


    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS