Write a program to find whether the shape is square or rectangle.
#include<stdio.h>
#include<conio.h>
void main()
{
int length,breadth;
clrscr();
printf("Enter the length and breadth\n");
scanf("%d%d",&length,&breadth);
if(length==breadth)
printf("it is a square");
else
printf("it is a rectangle");
getch();
}
Output:
run 1:
Enter the length and breadth
10
12
it is a rectangle
run 2:
Enter the length and breadth
20
20
it is a square
No comments: