Write a C++ program to check triangle by entering 3 angles

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();
}

#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();
}

 

Output:

Write a C++ program to check triangle by entering 3 angles Write a C++ program to check triangle by entering 3 angles

Another Program: Write a C++ program that asks for the number of units sold and computes the total cost of the purchase.

4 thoughts on “Write a C++ program to check triangle by entering 3 angles”

  1. Pingback: C++ projects for beginners with source code - Codeboks

  2. Pingback: The C Programming Language Structure with C Language data types

  3. Pingback: Top 40 projects with C++ for beginners in 2021

  4. Pingback: C++ Program to remove duplicate numbers in an array

Leave a Comment

Your email address will not be published.