Answers for "2. Write a C program to check whether a triangle is equilateral, isosceles or scalene triangle."

0

2. Write a C program to check whether a triangle is equilateral, isosceles or scalene triangle.

#include<stdio.h>
int main(){
   int side1, side2, side3;
   printf("Enter sides of triangle:");
   scanf("%d%d%d",&side1,&side2,&side3);
   if(side1 == side2 && side2 == side3)
      printf("The Given Triangle is equilateral\n");
   else if(side1 == side2 || side2 == side3 || side3 == side1)
      printf("The given Triangle is isosceles\n");
   else
      printf("The given Triangle is scalene\n");
   return 0;
}
Posted by: Guest on July-16-2021

Code answers related to "2. Write a C program to check whether a triangle is equilateral, isosceles or scalene triangle."

Browse Popular Code Answers by Language