HTML Tutorial || Networking Assignment || Computer Full Forms || Ms-Office Shortcut Keys || Ms-Office Notes || Number System Notes || Internet Assignment
JavaScript Tutorial || CSS Tutorial || Operating System Notes || History of Computer Assignment || Netwoking Notes || Computer Fundamentals Notes

C program to Check Whether the Triangle is Equilateral, Isosceles and Scalene Triangle Using If Else ?


Q:- Write a C program to Check Whether the Triangle is Equilateral, Isosceles and
        Scalene Triangle Using If Else ?
       Input
         #include<stdio.h>
         #include<conio.h>
         int main()
   {
int s1,s2,s3;
clrscr();
printf(“Enter Three Sides of Triangle =”);
scanf(“%d%d%d”,&s1,&s2,&s3);
if(s1==s2 && s2==s3)
{
printf(“Equilateral Triangle.”);
}
else if(s1==s2 || s1==s3)
{
printf(“Isosceles Triangle.”);
}
else
{
printf(“Scalene Triangle.”);
}
getch();
   }


Output

Enter Three Sides of Triangle =
30
20
30
Isosceles Triangle.

Comments