Write a C program to check whether a triangle is Equilateral, Isosceles or Scalene.

Write a C program to check whether a triangle is Equilateral, Isosceles or Scalene.

 Question:




Answer:


CODE:
#include<stdio.h> int main(){ int a,b,c; printf("Input three sides of triangle: "); scanf("%d %d %d",&a,&b,&c); if(a==b && b==c) printf("This is a equilatoral triangle"); else if((a==b && b!=c) || (a==c && b!=c) || (b==c && b!=a)) printf("This is a isosceles triangle"); else printf("This is a scalene triangle"); }


OUTPUT:






Previous Post
Next Post

post written by:

0 Comments: