Write a single statement that prints outsideTemperature with 2 digits in the fraction (after the decimal point). End with a newline. Sample output: 103.46
#include
int main(void) {
double outsideTemperature = 103.45632;

return 0;
}



Answer :

The program to question can be described as follows:

program:

#include <iostream> //defining header file

#include <iomanip> //defining header file

using namespace std;

int main() //defining main method

{

double outsideTemperature; //defining

double variable

outsideTemperature= 103.45632; //

initializing the value in variable

cout<<outsideTemperature<<": "<<setprecis

ion(2)<<fixed<<<outsideTemperature; //print

value

return 0;

}

Output: 103.456: 103.46

Description of code:

In above code first include header file for using the "setprecision" method.

In the next line, main method is declared, inside method, a double variable "outsideTemperature" is declared, that initialized with a float value.

Inside this method, "setprecision" method is called, which is predefined method, that prints two-point value after decimal point.

learn more about setprecision method at

https://brainly.com/question/22242435

#SPJ4

Other Questions