Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

LO2 Compare three types of individual incentives.

Answered: 1 week ago