128k views
3 votes
Assume that x is a double variable that has been initialized. Write a statement that prints it out, guaranteed to have a decimal point, but without forcing scientific (also known as exponential or e-notation).

1 Answer

3 votes

Answer:

cout <<showpoint << x; is the statement which prints the decimal point, but without forcing scientific.

Step-by-step explanation:

The showpoint function in c++ print the decimal point number without forcing scientific.The showpoint function set the showpoint format flag for the str stream in c++.

Following are the program in c++

#include<iostream> //header file

using namespace std; // namespace

int main() // main function

{

double x=90.67; // double variable

cout <<showpoint << x; // display x without forcing scientific

return 0;

}

Output

90.6700

User Mr Rogers
by
6.5k points