Question #165028

Write a single statement that prints outsideTemperature with 4 digits. End with newline. Sample output with input 103.45632:

103.5

Expert's answer




#include <bits/stdc++.h> 
using namespace std;
main(void)
{
	float temp = 123.45632;
	cout<<"\nInput Temp.  = "<<temp;
    //Single Line Statement
	cout<<setprecision(4)<<"\nOutput Temp. = "<<temp;
	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