google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a C++ program to find the area of triangle given three sides - 2nd puc computer science

Write a C++ program to find the area of triangle given three sides

Write a C++ program to find the area of triangle given three sides.

#include<iostream.h>

#include<conio.h>

#include<math.h>

void main( )

{

float s1, s2, s3, s, area;

clrscr( );

cout<<"Enter the length of three sides:";

cin>>s1>>s2>>s3;

s = (s1 + s2+ s3)/2;

area = sqrt( s* (s-s1) * (s-s2) * (s-s3));

cout<<"Area of triangle = "<<area<<endl;

getch();

}

Write a C++ program to find the area of triangle given three sides Write a C++ program to find the area of triangle given three sides Reviewed by Vision Academy on February 27, 2022 Rating: 5

No comments:

CheckOut

Powered by Blogger.