Ticker

6/recent/ticker-posts

C program to find area of circle.

 


Problem:-

To find the area of the circle.

How to run C program code

  • Open turbo C++.
  • click on File menu and select option new.
  • Write C code in new file.
  • Save file press  F2 functional key filename.c(.c is extention of c file).
  • Press CTRL+F9 to compile the C code.
  • Press CTRL+F5 to show output according to the code.

Algorithm:-

Step1:- Start.

Step2:-Read radius,area,Ï€.

Step3:- area=Ï€*radius*radius.

Step4:- Display area.

Step5:-  Stop.

Flowchart 


 C code to find the area of circle




Problem is to find area of circle. pi value is constant so that is defind using preprocessor  #define directive.  Two variable is use first is radius with integer datatype second is area with float datatype.Using printf and scanf (Input or output)function get the value of radius.Area of circle is ã… *radius*radius is mathematical formula to find the area of circle. Finally print the value of  area of circle using printf function. 








Post a Comment

0 Comments