Area of Circle | area of circle using c|
C PROGRAM TO FIND AREA OF CIRCLE google-site-verification: google92f1512c4881b7f9.html Code: #include <stdio.h> int main() { int area_of_circle,rad; float PI_VALUE=3.14; printf("Enter radius of circle: "); scanf("%d",&rad); area_of_circle = PI_VALUE *rad*rad; printf("Area of circle is: %d",area_of_circle); return(0); } Explanation: We are declaring the variable in integer data type. To find area of circle we need the value of Pi . So, we declare the value of Pi as "PI_VALUE=3.14" in float datatyp e . We getting the radius of the circle from the user. And storing the value of radius in "rad" . We declare it in float datatype because it a have value like point "...
.png)
.png)
.png)
Comments
Post a Comment