Sie sind auf Seite 1von 1

EXPERIMENT NO.

– 11
(Program to determine whether a triangle is equilateral, isosceles or scalene
and perform decision table based testing and draw cause effect graph.)

#include<conio.h>
#include<iostream.h>
#include<stdlib.h>
#include<stdio.h>
void main()
{
clrscr();
cout<<"Enter sides of triangle: ";
int a,b,c;
cin>>a>>b>>c;
if(a<1 || a>100 || b<1 || b>100 || c<1 || c>100)
{
cout<<"Out of range";
getch();
exit(0);
}
if((a>=b+c) || (b>=a+c) || (c>=b+a))
cout<<"Not a triangle";
else if(a==b && b==c)
cout<<"Equilateral triangle";
else if(a==b || b==c || a==c)
cout<<"Isosceles triangle";
else
cout<<"Scelene triangle";
getch();
}

Das könnte Ihnen auch gefallen