/*Write a c program to accept the radius to find the area of a circle */ #include <stdio.h> #include <stdlib.h> #define pi 3.14 int main() { int r ; float area; printf("Enter the radius of a circle:\n"); scanf("%d",&r); area = pi *r *r ; printf("The area of a circle is : %.2f \n", area); return 0; }
Enter the radius of a circle: 6 The area of a circle is : 113.04
No comments:
Post a Comment