check whether triangle is equilateral, scalene or isosceles
C Program
#include <stdio.h>
#include <stdlib.h>
int main()
{
int side1,side2,side3;
printf("Enter Side of length-1:");
scanf("%d",&side1);
printf("Enter Side of length-2:");
scanf("%d",&side2);
printf("Enter Side of length-3:");
scanf("%d",&side3);
if(side1==side2 && side1==side3|| side2==side3 && side2==side1)
printf("Equilateral");
else if(side1==side2 && side1!=side3 || side1==side3 && side1!=side2)
printf("Isoceles");
else
printf("Scalene");
}
0 Comments:
Post a Comment