find the c program of area and perimeter of square and rectangle
Answers
Answered by
6
Answer:
#include<stdio.h>
#include<conio.h>
void main()
{
int a, l, b, ,area1,perimeter1,area2,perimeter2;
clrscr();
printf("\n enter the value of a, l, b:");
scanf("%d%d%d",&a,&l, &b);
area1 =a*a*a;
perimeter1=4a;
area2=l*b;
perimeter2=2*(l+b);
printf("\nThe values are given as:");
printf("\n area of square: \n perimeter of square :\n Area of rectangle :\n perimeter of rectangle :",area1, perimeter1, area2, perimeter2);
getch();
}
output
enter the value of a, l, b:
2 3 4
the values are given as :
area of square :4
perimeter of square :8
area of rectangle :12
perimeter of rectangle :24
Similar questions
Social Sciences,
6 months ago
Science,
6 months ago
English,
6 months ago
Science,
1 year ago
English,
1 year ago