Saturday, 29 July 2017

11D-Prg5 Write a algorithm and program to read the radius of a circle and print the area and circumference of the circle.


Algorithm
Input
1. r  // radius

Output
1. ar  // area of circle
2. cr  // circumference

Method:
1. start
2. Read r
3. Write r
4. ar=3.14*r*r  // ar=3.14*pow(r,2); //#include<math.>
5. cr=2*3.14*r
6. write r and cr
7. stop

Example:

1. r=2
   ar=3.14*2*2
   ar=12.56

   cr=2*3.14*2
   cr=12.56

No comments:

Post a Comment