Question: write the program in C language. PART A: Write a C program that reads double numbers from a text file named matrix.txt into a two-dim

 write the program in C language. PART A: Write a C

write the program in C language.

PART A: Write a C program that reads double numbers from a text file named matrix.txt into a two-dim array with the size 7x4 and displays the contents of the array. matrix.txt Example Run: 19.8 34.6 7.6 11.2 The contents of the array is: 45.7 24.1 43.1 5.6 19.8 34.6 7.6 11.2 6.8 9.0 22.3 1.2 45.7 24.1 43.1 5.6 22.4 84.5 76.2 12.1 6.8 9.0 22.3 1.2 77.6 54.3 43.7 98.0 22.4 84.5 76.2 12.1 45.7 76.3 45.3 5.1 77.6 54.3 43.7 98.0 1.5 8.9 12.6 13.7 45.7 76.3 45.3 5.1 1.5 8.9 12.6 13.7 PART B: After you finish Part A, ask the user to enter two row indexes to swap and validate the input (must be between 0 and 7). Then, swap these rows of the array. (Hint: Use a one-dim temprorary array to do the swap operation.) Example Run: The contents of the array is: 19.8 34.6 7. 11.2 45.7 24.1 43.1 5.6 6.8 9.0 22.3 1.2 22.4 84.5 76.2 12.2 77.6 54.3 43.7 98.0 45.7 76.3 45.3 5.2 1.5 8.9 12.6 13.7 Enter two row indexes to swap: 19 Enter two row indexes to swap: -1 4 Enter two row indexes to swap: 0 2 The contents of the array AFTER the swap operation: 6.8 9.0 22.3 1.2 45.7 24.1 43.1 5.6 19.8 34.6 7.6 11.2 22.4 84.5 76.2 12.1 77.6 54.3 43.7 98.0 45.7 76.3 45.3 5.1 1.5 8.9 12.6 13.7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!