Write a C++ program to input the three sides of a triangle and display whether it forms a right-angled triangle. (Note. if a ^ 2 + b ^ 2 = c ^ 2 , it forms a right-angled triangle. It is also called as Pythagoras theorem.)
Answers
Answered by
5
Answer:
#include <iosteam>
using namespace std;
int main(){
cout<<"Write the measurement of the sides a,b and c of triangle ABC."<<endl;
Int a,b,c;
cout<<"Side a = "<<cin>>a<<endl;
cout<<"Side b = "<<cin>>b<<endl;
cout<<"Side c = "<<cin>>c<<endl;
if (a^2 + b^2 = c^2) {
cout<<"This is a right angled triangle."<<endl;
}
else {
cout<<"This is not a right angled triangle."<<endl;
}
return 0;
}
Similar questions
India Languages,
29 days ago
Science,
29 days ago
Math,
1 month ago
English,
1 month ago
Math,
9 months ago