#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int length, breadth,area_of_square,perimeter_of_square, perimeter_of_rectangle,area_of_rectangle,side;
printf("\n Enter length and breadth of the rectangle :");
scanf("\n %d%d",&length,&breadth);
printf("\n Enter Side of Square :");
scanf("\n %d",&side);
area_of_rectangle=length*breadth;
perimeter_of_rectangle=(2*length)+(2*breadth);
area_of_square=side*side;
perimeter_of_square=4*side;
printf("\n Area of rectangle = %d \tPerimeter=%d",area_of_rectangle,perimeter_of_rectangle);
printf("\n Area of square = %d \t\t Perimeter=%d",area_of_square,perimeter_of_square);
getch();
}
Run:
Previous Next
#include<conio.h>
void main()
{
clrscr();
int length, breadth,area_of_square,perimeter_of_square, perimeter_of_rectangle,area_of_rectangle,side;
printf("\n Enter length and breadth of the rectangle :");
scanf("\n %d%d",&length,&breadth);
printf("\n Enter Side of Square :");
scanf("\n %d",&side);
area_of_rectangle=length*breadth;
perimeter_of_rectangle=(2*length)+(2*breadth);
area_of_square=side*side;
perimeter_of_square=4*side;
printf("\n Area of rectangle = %d \tPerimeter=%d",area_of_rectangle,perimeter_of_rectangle);
printf("\n Area of square = %d \t\t Perimeter=%d",area_of_square,perimeter_of_square);
getch();
}
Run:
Previous Next
No comments:
Post a Comment