Write a program to input length and width of a shape and find shape is square or rectangle.

About Program
In this program we input length and width of a shape and check what kind of shape.
   To understand this program you should knowledge of some basic conditional statements (if-else) program. Some Basic conditional statements programs are below.
   If length and width of shape is same then we print Square else print Rectangle.

#include<stdio.h>
#include<conio.h>
void main()
{
int l,w;
clrscr();
printf("Enter length and width of shape=");
scanf("%d%d",&l,&w);
if(l==w)
 printf("\nShape is Square");
else
 printf("\nShape is Rectangle");
getch();
}

OUTPUT

Enter length and width of shape=5
5
Shape is Square
                  OR
Enter length and width of shape=5
6
Shape is Rectangle

Related Examples 

  1. Write a program to input sell price and cost price and find transaction is profit or loss. 
  2. Write a program to input a number and check number is odd or even.
  3. Write a program to input two number and find smallest number.
  4.  Write a program to input two number and find highest number. 

    1.  Share and Comment. 
      Follow for recently updates. 

    Comments

    Popular posts from this blog

    Write a program to input age of any person and check he is eligible for voting or not.

    Write a program to input two digit number and check number is palindrome or not.

    Write a program to input speed of Royal Enfield and check it's running at economic speed or not.