C++ examples for Data Type:int
Computes a circle with radius of 5 and 20.
#include <iostream> using namespace std; int main()/*from w ww .jav a 2s.c o m*/ { const float PI = 3.14159; float radius = 5; float area; area = radius * radius * PI; // Circle area calculation cout << "The area is " << area << " with a radius of 5.\n"; radius = 20; // Compute area with new radius. area = radius * radius * PI; cout << "The area is " << area << " with a radius of 20.\n"; return 0; }