+1(805) 568 7317

please basic simple c language so printf 39 s and scanf 39 s not cout or cin no arra 5188809

Please basic simple C language, so printf's and scanf's not cout or cin, NO ARRAYS!!!! Thank you so much!

The input file tripletsin.txt consists of a series of lines, each of which contains three numbers (a triplet). For example the input file might contain the following:

3.2 -4.1 8.6

5.6 1.2 0.3

Write a function called triplets which reads these lines one at a time and writes out the numbers ordered from smallest to largest to an output file called tripletsout.txt. Your function must return the number of triplets (i.e. lines) read. Also, your function must not make use of any functions other than fscanf and fprintf. That is, you must devise the required if-else structure to accomplish the required ordering yourself. Write a main function to test your triplets function. The main must open and close the input and output files (this must not be done in the function), call the function, and then print out the number of triplets read. For example, if triplesin.txt contains the lines indicated above, then triplesout.txt should contain

-4.100000 3.200000 8.600000

0.3000000 1.200000 5.600000

and the main should report

Number of triplets read = 2

"Order a similar paper and get 15% discount on your first order with us
Use the following coupon

Order Now