google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a program to find whether the shape is square or rectangle. - 2nd puc computer science

Write a program to find whether the shape is square or rectangle.

 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                                   

Write a program to find whether the shape is square or rectangle.  Write a program to find whether the shape is square or rectangle. Reviewed by Vision Academy on December 07, 2021 Rating: 5

No comments:

CheckOut

Powered by Blogger.