Sunday, September 9, 2018

21. WAP to check whether a triangle is equilateral, isosceles or scalene.

#include<stdio.h>
#include<conio.h>
void main()
{
   int a,b,c;
   printf("Enter the length of the sides of the triangle: ");
   scanf("%d%d%d",&a,&b,&c);        
   if(a==b && b==c)
      printf("\nEquilateral Traingle.");
   else if( (a==b) || (b==c) || (c==a) )
      printf("\nIsosceles Triangle.");
   else
      printf("\nScalene Triangle.");
   getch();
}


Output:






Please have a look at the below lesson posted on my YouTube channel:


No comments:

Post a Comment