PROBLEM M5B-3: Write a complete program (Filename : ARRAY_M5B_3 ) that will Two-Dimensional array A[5][5] with the first 25 numbers, then print the following : a.) the content of the original array b.) the content of the array with the elements of the 2d row and 4th row interchang c.) the content of the array with the elements of the 3rd col and 5t col interchanged d.) the content of the array with the 2 diagonal elements interchanged. SAMPLE OUTPUT : OUTPUT NO. 1 :ORIGINAL ARRAY ELEMENTS 1. 2 4 8. 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 <----- OUTPUT NO.2 : INTERCHANGE ROW 2 WITH ROW 4 ELEMENTS - -- --> 1 2 3 4 5 16 17 18 19 20 11 12 13 14 15 7 8. 10 21 22 23 24 25 <------- OUTPUT NO.3: INTERCHANGE COL 3 WITH COL 5 ELEMENTS - 1 2 4 3. 6 7 10 11 12 15 14 13 16 17 20 19 18 21 22 25 24 23 ---- OUTPUT NO. 4: INTERCHANGE THE DIAGONAL ELEMENTS -----> 2 3 9. 8 7 10 11 12 13 14 15 16 19 18 17 20 25 22 23 24 21 3. 6. 6.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
PROBLEM M5B-3: Write a complete program (Filename : ARRAY_M5B_3 ) that will load a
Two-Dimensional array A[5][5] with the first 25 numbers, then print the following :
a.) the content of the original array
b.) the content of the array with the elements of the 2nd row and 4th row interchanged.
c.) the content of the array with the elements of the 3d col and 5th col interchanged.
d.) the content of the array with the 2 diagonal elements interchanged.
SAMPLE OUTPUT :
OUTPUT NO. 1: ORIGINAL ARRAY ELEMENTS-
1
2
4
5
7
9.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<----- OUTPUT NO.2 : INTERCHANGE ROW 2 WITH ROW 4 ELEMENTS
--->
1 2 3 4 5
16
17
18
19
20
11
12
13
14
15
6
7
8
9.
10
21
22
23
24
25
<------- OUTPUT NO.3: INTERCHANGE COL 3 WITH COL 5 ELEMENTS -
2
3
6.
7
10
9.
8
11
12
15
14
13
16
17
20
19
18
21
22
25
24
23
<----- OUTPUT NO. 4: INTERCHANGE THE DIAGONAL ELEMENTS ----->
3
4
1
8.
7
10
11
12
13
14
15
16
19
18
17
20
25
22
23
24
21
4.
2.
Transcribed Image Text:PROBLEM M5B-3: Write a complete program (Filename : ARRAY_M5B_3 ) that will load a Two-Dimensional array A[5][5] with the first 25 numbers, then print the following : a.) the content of the original array b.) the content of the array with the elements of the 2nd row and 4th row interchanged. c.) the content of the array with the elements of the 3d col and 5th col interchanged. d.) the content of the array with the 2 diagonal elements interchanged. SAMPLE OUTPUT : OUTPUT NO. 1: ORIGINAL ARRAY ELEMENTS- 1 2 4 5 7 9. 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 <----- OUTPUT NO.2 : INTERCHANGE ROW 2 WITH ROW 4 ELEMENTS ---> 1 2 3 4 5 16 17 18 19 20 11 12 13 14 15 6 7 8 9. 10 21 22 23 24 25 <------- OUTPUT NO.3: INTERCHANGE COL 3 WITH COL 5 ELEMENTS - 2 3 6. 7 10 9. 8 11 12 15 14 13 16 17 20 19 18 21 22 25 24 23 <----- OUTPUT NO. 4: INTERCHANGE THE DIAGONAL ELEMENTS -----> 3 4 1 8. 7 10 11 12 13 14 15 16 19 18 17 20 25 22 23 24 21 4. 2.
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education