Write a C++ program to check triangle by entering 3 angles
Write a C++ program to check triangle by entering 3 angles
Object:
Write a C++ program to check triangle by entering 3 angles. C++ Projects.
Code:
#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
float ang1, ang2, ang3;
cout<<“\n\t*******************************************************************\n”;
cout<<“\t\t:P r o g r a m to c h e c k T r i a n g l e:\n”;
cout<<“\t*******************************************************************\n\n”;
cout<<“Enter the Angles of Triangle.\n”;
cout<<“Enter Angle 1: “;
cin>>ang1;
cout<<“Enter Angle 2: “;
cin>>ang2;
cout<<“Enter Angle 3: “;
cin>>ang3;
if(ang1+ang2+ang3 == 180)
{
cout<<“Triangle is Valid.”;
}
else
{
cout<<“Triangle is Invalid.”;
}
getch();
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #include<iostream> #include<conio.h> using namespace std; void main() { float ang1, ang2, ang3; cout<<"\n\t*******************************************************************\n"; cout<<"\t\t:P r o g r a m to c h e c k T r i a n g l e:\n"; cout<<"\t*******************************************************************\n\n"; cout<<"Enter the Angles of Triangle.\n"; cout<<"Enter Angle 1: "; cin>>ang1; cout<<"Enter Angle 2: "; cin>>ang2; cout<<"Enter Angle 3: "; cin>>ang3; if(ang1+ang2+ang3 == 180) { cout<<"Triangle is Valid."; } else { cout<<"Triangle is Invalid."; } getch(); } |
2 Responses
[…] Write a C++ program to check triangle by entering 3 angles […]
[…] Write a C++ program to check triangle by entering 3 angles […]