Hi. I am new in c programming language. I want to right C code for area of circle. Please give me the proper codes it is highly appreciated.
Hi. I am new in c programming language. I want to right C code for area of circle. Please give me the proper codes it is highly appreciated.
Try this, it will helpful for you.
Code:#include <stdio.h> #define PI 3.14159 int main() { float area , radius ; printf("Enter the radius of the circle.n"); scanf("%f",&radius); area = PI * radius * radius; printf("The area of a circle is %f.n",area); return 0; }
Try out this code, when you run this program you get the area of circle as an output result:
Code:#include<stdio.h> #include<conio.h> main() { int r; float a; print f ("Enter r value n"); scan f ("%d", &r); a=3.14*r*r; print f("area=%f",a); }
Bookmarks