| 14 | } // end function "area" |
| 15 | |
| 16 | int main1() |
| 17 | { |
| 18 | float radius; |
| 19 | cout << "Please enter the radius of circle: "; |
| 20 | cin >> radius; // inputing the radius |
| 21 | |
| 22 | if (radius > 0) |
| 23 | cout << area(radius) << endl; // calling the function "area" for calculating the Area of Circle |
| 24 | |
| 25 | else |
| 26 | cout << "INVALID Radius!" << endl; // if radius is a negative number or equal to zero the program will show "Invalid radius" |
| 27 | system("pause"); |
| 28 | return 0; |
| 29 | } |