Here you will find a variety of videos on technology, Tutorials, News, Tip And Tricks, Reviews

Breaking

Post Top Ad

Your Ad Spot

Monday, June 1, 2015

To calculate area of a circle by taking radius as input with algorithms, Flowchart and coding.




Algorithm:



Step 1: Start


Step 2: Input value of radius


Step 3: Calculate area ( area = 3.14 * radius * radius )


Step 4: Display value of area


Step 5: Stop.

Flowchart:




Program:



  #include<stdio.h>

  int main()

  {

     
 int radius;

  
    float PI = 3.14, area;

      printf(
"\n Enter radius of circle: ");

      scanf(
"%d", &radius);

      area = PI * radius * radius;

      printf(
"\n Area of circle : %f ", area);
 
 
      return (0);


  }


Output:


Enter radius of circle: 3

Area of circle : 28.260000

No comments:

Post a Comment

Post Top Ad

Your Ad Spot

Pages