[code][output]#include <iostream.h>
int main()
{
int a, b, c, d, q;
cout<<"what you wanna do???\n";
cin>>q;
if (q=='1')
{
cout<<"first side\n";
cin>>a;
cout<<"second side\n";
cin>>b;
cout<<"third side\n";
cin>>c;
if ((a>b)&&(a>c))
{
d=b+c;
if (d>a)
cout<<"triangle is valid\n";
else
cout<<"it is not valid\n";
}
elseif((b>c)&&(b>a))
{
d=c+a;
if(d>b)
cout<<"triangle is valid\n";
else
cout<<"triangle not valid\n";
}
elseif((c>a)&&(c>b))
{
d=a+b;
if(d>c)
cout<<"triangle is valid\n";
else
cout<<"triangle not valid\n";
}
}
if (q=='2')
{
cout<<"tell 1 sides\n";
cin>>a;
cout<<"2nd\n";
cin>>b;
cout<<"and 3rtd\n";
cin>>c;
if((a=='b')&&(b=='c')&&(c=='a'))
cout<<"equilatera; triangle\n";
elseif((a==b&&a!=c)||(b==c&&b!=a)||(a==c&&c!=b))
cout<<"iscosceles\n";
elseif(a!=b!=c)
cout<<"scalene\n";
system("pause");
}
return 0;
}
[/ou
tput]
[/code]
guyzz it is a program in which i have combined 2 other programs..
after the first cout , when i enter the number of the conditional operator , it is closing down.. automatically.. i mean the application window.
the 2 programs are
wheither a triangle is valid [for 1]
2 tell the triangle type[for 2]