#include<stdio.h>
#include<conio.h>
void main()
{
int side, peri_s, area_s,len, bre, peri_r, area_r;
clrscr();
printf("Enter length of a side of square :");
scanf("%d",&side);
area_s=side*side;
peri_s=4*side;
printf("Area of square = %d\tPerimeter of square=%d",area_s,peri_s);
printf("\n\nEnter length and breadth of the rectangle :");
scanf("%d%d",&len,&bre);
area_r=len*bre;
peri_r=(2*len)+(2*bre);
printf("Area of rectangle = %d\tPerimeter of rectangle=%d",area_r,peri_r);
getch();
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.