87.7k views
5 votes
. double x = 5; declares that x is a...............variable.

1 Answer

4 votes

Answer:

x is a double type variable.

Explanation:

Here is x is a variable of type double which stores the value 5. The main purpose of a double datatype is storing the decimal point values. The precision of double datatype is two times more than the precision of float datatype. So on displaying the value of x in c++ it prints "5".

Following are the program of double datatype in c++

#include <iostream> // header file

using namespace std; // namespace

int main() // main function

{

double x=5; // variable declaration

cout<<x; // displaying the value of x

return 0;

}

Output:

5

User Uma Raja
by
9.1k points

No related questions found