Write a program to enter length and breadth of a room and check if it's a rectangular or square room

#include<stdio.h>
void main()
{
   int l,b;
   printf("Enter length and breadth of room:");
   scanf("%d %d", &l, &b);
   if(l==b)
   {
     printf("\nLength and breadth of room is equal");
     printf("\nThis is a square room");
    }
   else
    {
     printf("\nLength and breadth of room is not equal");
     printf("\nThis is a rectangular room");
    }
 }

Here, parantheses is used because two statements are there in the body of if and else.


Post a Comment

0 Comments