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();
}
#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(); }
Pingback: C++ projects for beginners with source code - Codeboks
Pingback: The C Programming Language Structure with C Language data types
Pingback: Top 40 projects with C++ for beginners in 2021
Pingback: C++ Program to remove duplicate numbers in an array