/* * This program calcuates area of a circle, taking input fot its radius. * Copyright (C) 2006 Roshan Baladhanvi * * This program is a free software; you can redistribute it and/or modify it under the terms of GNU * General Public License Version 2, as published by the Free Software Foundation * * This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without * even the implied warranty of MECHANTIBILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * The GPL License is currently published at the following URL * http://www.fsf.org/licensing/licenses/gpl.html * * The author of the program can be contacted at d_rosh2001 at yahoo dot co dot in */ #include #include #define PI 3.14159265 main(){ float radius, area; printf("Enter radius of the circle: "); scanf("%f", &radius); if(radius <= 0){ printf("Not a valid input. Quitting\n"); exit(0); } area = PI * pow(radius, 2); printf("Area of circle with radius %.2f is %.2f\n", radius, area); }