Answer to Question #3356 in C++ for mukunda

Question #3356
Write a program to print a triangle width.
1
Expert's answer
2011-07-21T08:09:40-0400
#include <iostream>
using namespace std;

int main()
{
double triangle[3] = { 10.0, 20.0, 30.0 };
double triangle_width = triangle[0];
for (int i = 1; i < 3; ++i)
& if (triangle_width < triangle[i])
& triangle_width = triangle[i];
cout << "Triangle width is " << triangle_width << endl;
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS