#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:
#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:
No comments:
Post a Comment