A look at floats in C++.

FLoats in C++.

Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Wednesday July 30th, 2008 11:44 PM

#include <iostream>

using namespace std;

int main() {

    // putting f after the number allows it to compile a little faster: good practice
    float fMyValue  25.5f;
    float fAddValue 25.0f;
    float fFinished fMyValue fAddValue;
    cout << "\n";
    cout << fFinished << endl;

    return 0;


Download: floats.cpp 342 B

Please login or Click Here to register for downloads
Creative Commons License
Floats by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at www.3daet.com
Permissions beyond the scope of this license may be available at http://www.3daet.com