Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

C++ float and double simple example

#include <iomanip>
#include <iostream>
using namespace std;

int main() {
    // Creating a double type variable
    double a = 3.912348239293;

    // Creating a float type variable
    float b = 3.912348239293f;

    // Printing the two variables
    cout << "Double Type Number  = " << a << endl;
    cout << "Float Type Number  = " << b << endl;

    return 0;
}
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #float #double #simple
ADD COMMENT
Topic
Name
6+3 =