Write simple programs to calculate the area and perimeter of the rectangle, and the area & circumference of the circle.

This post content:-
  • Algorithm
  • Flowchart
  • C code
  • Output
  • PDF notes

Algorithm:-
Step 1:- start.
Step 2:- declare variables length,breadth, radius, aor, por, aoc, coc;
Step 3:- take input of Length and Breadth of the Rectangle.
Step 4:- take input of Radius of the Circle.
Step 5:- calculate the area and perimeter of the rectangle, and the area & circumference of the circle. As follow:-
/*
aor: area of rectangle
por: perimeter of rectangle
aoc: area of circle
coc: circumference of circle
*/

aor = length*breadth;
por= 2*(length+breadth);
 
 
aoc = 3.14*radius*radius;
 
coc = 2*radius*3.14;

Step 6:- print the values.
Step 7:- END.

Flowchart:-

C code:-
Output:-
Try it yourself:-

Comments

Popular posts from this blog

Develop and execute C Program to Add Two Distances given in kilometer-meter Using Structures.

Develop a c program to find the sum of all elements stored in a given array using a pointer.