Program reads in three integers representing line lengths


Assignment:

Q: Write a C++ program that reads in three integers representing line lengths, and determines if the three line segments form a right triangle. If it is not a right triangle, is it a valid triangle. Allow the three numbers to be input in any order. An input number 'n' will be in the range [1,5000]. The program should read the data from a file called triangleFile.dat and then write the results into an output file.

Attached document contains following test data.

3 4 5
55 25 25
20 48 52
123 345 299
2002 4001 1050
441 588 735
4999 4999 4999
648 702 270
100 200 500
88 50 60
72 120 48
75 60 45
1000 50 1100

Attachment:- triangular data.rar

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Program reads in three integers representing line lengths
Reference No:- TGS01936920

Now Priced at $20 (50% Discount)

Recommended (98%)

Rated (4.3/5)