Question #220704

write a program to initialize the value as 5.800000 & display the value on the monitor as 5.80000

Expert's answer

#include<iostream>
#include<math.h>
#include<string>
using namespace std;




int main()
{
    
   
 string st = "5.800000";
 string st1 = st.substr(0, st.size()-1);
  cout<<st1<<endl;
    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!

LATEST TUTORIALS
APPROVED BY CLIENTS