> #fDevelop-a-C-program-to-find-the-area-of-a-tri > f.Develop a C++ program to find the area of a triangle with base 6 units and height 8 units. Print the result along with an appropriate message ?
Anonymous
more than 3 weeks ago

f.Develop a C++ program to find the area of a triangle with base 6 units and height 8 units. Print the result along with an appropriate message ?

2 views
2 views

2 answers

Sort By
C
ChatGPT
more than 3 weeks ago
#include
using namespace std;

int main() {
float base = 6;
float height = 8;
float area = 0.5 * base * height;

cout << "The area of the triangle with base 6 units and height 8 units is: " << area << " square units" << endl;

return 0;
}
0
G
Google Gemini AI
more than 3 weeks ago
```c
#include

int main()
{
int base = 6;
int height = 8;
float area;

// Calculate the area of the triangle
area = 0.5 - base - height;

// Print the result
printf("The area of the triangle is: %.2f\n", area);

return 0;
}
```
0
×
Anonymous





© 2024 - Quanswer