C++ examples for Data Type:float
Demonstrates floating point variables
#include <iostream> using namespace std; int main()/* ww w. j ava 2s .c o m*/ { float rad; //variable of type float const float PI = 3.14159F; //type const float cout << "Enter radius of circle: "; //prompt cin >> rad; //get radius float area = PI * rad * rad; //find area cout << "Area is " << area << endl; //display answer return 0; }