SlideShare a Scribd company logo
1 of 7
Download to read offline
Please find the required program below with output:
#include
void transposeMatrix(int arr[][5], int trans[][4]){
for (int j = 0; j < 5; ++j)
{
for (int i = 0; i < 4; ++i)
{
trans[j][i] = arr[i][j]; // just reversing the address i,j to j,i so that the transpose will be made
}
}
}
void main()
{
int array[4][5], trans[5][4];
int i, j;
printf("Enter the elements of matrix ");
for (i = 0; i < 4; ++i)
{
for (j = 0; j < 5; ++j)
{
scanf("%d", &array[i][j]); // reading the 4x5 matrix array
}
}
printf("The matrix is  "); //just printing the user input array
for (i = 0; i < 4; ++i)
{
for (j = 0; j < 5; ++j)
{
printf(" %d", array[i][j]);
}
printf(" ");
}
transposeMatrix(array,trans); //calling the transposeMatrix method, so that the transpose of the
matrix array will be stored in trans
printf("Transpose of matrix is  "); //just printing the returned transpose matrix trans
for (i = 0; i < 5; ++i)
{
for (j = 0; j < 4; ++j)
{
printf(" %d", trans[i][j]);
}
printf(" ");
}
}
---------------------------------------------------------------------------------
OUTPUT:
Enter the elements of
matrix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
The matrix
is
1 2 3 4
5
6 7 8 9
10
11 12 13 14 15
16 17 18 19
20
Transpose of matrix
is
1 6 11
16
2 7 12
17
3 8 13
18
4 9 14
19
5 10 15 20
Solution
Please find the required program below with output:
#include
void transposeMatrix(int arr[][5], int trans[][4]){
for (int j = 0; j < 5; ++j)
{
for (int i = 0; i < 4; ++i)
{
trans[j][i] = arr[i][j]; // just reversing the address i,j to j,i so that the transpose will be made
}
}
}
void main()
{
int array[4][5], trans[5][4];
int i, j;
printf("Enter the elements of matrix ");
for (i = 0; i < 4; ++i)
{
for (j = 0; j < 5; ++j)
{
scanf("%d", &array[i][j]); // reading the 4x5 matrix array
}
}
printf("The matrix is  "); //just printing the user input array
for (i = 0; i < 4; ++i)
{
for (j = 0; j < 5; ++j)
{
printf(" %d", array[i][j]);
}
printf(" ");
}
transposeMatrix(array,trans); //calling the transposeMatrix method, so that the transpose of the
matrix array will be stored in trans
printf("Transpose of matrix is  "); //just printing the returned transpose matrix trans
for (i = 0; i < 5; ++i)
{
for (j = 0; j < 4; ++j)
{
printf(" %d", trans[i][j]);
}
printf(" ");
}
}
---------------------------------------------------------------------------------
OUTPUT:
Enter the elements of
matrix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
The matrix
is
1 2 3 4
5
6 7 8 9
10
11 12 13 14 15
16 17 18 19
20
Transpose of matrix
is
1 6 11
16
2 7 12
17
3 8 13
18
4 9 14
19
5 10 15 20

More Related Content

Similar to Please find the required program below with output#include stdio.pdf

Merge sort in CSolution#include-stdio-h- #define MAX 50 void mergeSort.docx
Merge sort in CSolution#include-stdio-h- #define MAX 50 void mergeSort.docxMerge sort in CSolution#include-stdio-h- #define MAX 50 void mergeSort.docx
Merge sort in CSolution#include-stdio-h- #define MAX 50 void mergeSort.docxscroghamtressie
 
C Programming Language Part 8
C Programming Language Part 8C Programming Language Part 8
C Programming Language Part 8Rumman Ansari
 
Cse115 lecture08repetitionstructures part02
Cse115 lecture08repetitionstructures part02Cse115 lecture08repetitionstructures part02
Cse115 lecture08repetitionstructures part02Md. Ashikur Rahman
 
VIT351 Software Development VI Unit2
VIT351 Software Development VI Unit2VIT351 Software Development VI Unit2
VIT351 Software Development VI Unit2YOGESH SINGH
 
Using an Array include ltstdiohgt include ltmpih.pdf
Using an Array include ltstdiohgt include ltmpih.pdfUsing an Array include ltstdiohgt include ltmpih.pdf
Using an Array include ltstdiohgt include ltmpih.pdfgiriraj65
 
Data Structure using C
Data Structure using CData Structure using C
Data Structure using CBilal Mirza
 
SeaJUG March 2004 - Groovy
SeaJUG March 2004 - GroovySeaJUG March 2004 - Groovy
SeaJUG March 2004 - GroovyTed Leung
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solutionAzhar Javed
 
SPL 11.1 | Problems on Loop , Nested Loop
SPL 11.1 | Problems on Loop , Nested LoopSPL 11.1 | Problems on Loop , Nested Loop
SPL 11.1 | Problems on Loop , Nested LoopMohammad Imam Hossain
 
Network lap pgms 7th semester
Network lap pgms 7th semesterNetwork lap pgms 7th semester
Network lap pgms 7th semesterDOSONKA Group
 
#include stdio.hint main() {     int count;     FILE myFi.pdf
#include stdio.hint main() {     int count;     FILE myFi.pdf#include stdio.hint main() {     int count;     FILE myFi.pdf
#include stdio.hint main() {     int count;     FILE myFi.pdfanithareadymade
 

Similar to Please find the required program below with output#include stdio.pdf (20)

Merge sort in CSolution#include-stdio-h- #define MAX 50 void mergeSort.docx
Merge sort in CSolution#include-stdio-h- #define MAX 50 void mergeSort.docxMerge sort in CSolution#include-stdio-h- #define MAX 50 void mergeSort.docx
Merge sort in CSolution#include-stdio-h- #define MAX 50 void mergeSort.docx
 
C Programming Language Part 8
C Programming Language Part 8C Programming Language Part 8
C Programming Language Part 8
 
Array
ArrayArray
Array
 
Cse115 lecture08repetitionstructures part02
Cse115 lecture08repetitionstructures part02Cse115 lecture08repetitionstructures part02
Cse115 lecture08repetitionstructures part02
 
VIT351 Software Development VI Unit2
VIT351 Software Development VI Unit2VIT351 Software Development VI Unit2
VIT351 Software Development VI Unit2
 
Using an Array include ltstdiohgt include ltmpih.pdf
Using an Array include ltstdiohgt include ltmpih.pdfUsing an Array include ltstdiohgt include ltmpih.pdf
Using an Array include ltstdiohgt include ltmpih.pdf
 
Arrays
ArraysArrays
Arrays
 
Program presentation
Program presentationProgram presentation
Program presentation
 
Data Structure using C
Data Structure using CData Structure using C
Data Structure using C
 
Java introduction
Java introductionJava introduction
Java introduction
 
SeaJUG March 2004 - Groovy
SeaJUG March 2004 - GroovySeaJUG March 2004 - Groovy
SeaJUG March 2004 - Groovy
 
C_Arrays.pptx
C_Arrays.pptxC_Arrays.pptx
C_Arrays.pptx
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solution
 
SPL 11.1 | Problems on Loop , Nested Loop
SPL 11.1 | Problems on Loop , Nested LoopSPL 11.1 | Problems on Loop , Nested Loop
SPL 11.1 | Problems on Loop , Nested Loop
 
Network lap pgms 7th semester
Network lap pgms 7th semesterNetwork lap pgms 7th semester
Network lap pgms 7th semester
 
Cpds lab
Cpds labCpds lab
Cpds lab
 
DSC program.pdf
DSC program.pdfDSC program.pdf
DSC program.pdf
 
C arrays
C arraysC arrays
C arrays
 
6_Array.pptx
6_Array.pptx6_Array.pptx
6_Array.pptx
 
#include stdio.hint main() {     int count;     FILE myFi.pdf
#include stdio.hint main() {     int count;     FILE myFi.pdf#include stdio.hint main() {     int count;     FILE myFi.pdf
#include stdio.hint main() {     int count;     FILE myFi.pdf
 

More from anonakitchen

1) Current assets = Net working capital + Current liabilities = $1,0.pdf
1) Current assets = Net working capital + Current liabilities = $1,0.pdf1) Current assets = Net working capital + Current liabilities = $1,0.pdf
1) Current assets = Net working capital + Current liabilities = $1,0.pdfanonakitchen
 
-7 & 16Solution-7 & 16.pdf
-7 & 16Solution-7 & 16.pdf-7 & 16Solution-7 & 16.pdf
-7 & 16Solution-7 & 16.pdfanonakitchen
 
(a). The posterior pole of the embryo of drosophila contains essenti.pdf
(a). The posterior pole of the embryo of drosophila contains essenti.pdf(a). The posterior pole of the embryo of drosophila contains essenti.pdf
(a). The posterior pole of the embryo of drosophila contains essenti.pdfanonakitchen
 
As per interest rate parity, Expected.pdf
    As per interest rate parity,                              Expected.pdf    As per interest rate parity,                              Expected.pdf
As per interest rate parity, Expected.pdfanonakitchen
 
With the HNMR the two CH3s are chemically equiv.pdf
                     With the HNMR the two CH3s are chemically equiv.pdf                     With the HNMR the two CH3s are chemically equiv.pdf
With the HNMR the two CH3s are chemically equiv.pdfanonakitchen
 
there is no image .pdf
                     there is no image                               .pdf                     there is no image                               .pdf
there is no image .pdfanonakitchen
 
resonance structures 1 and 3 from the top reson.pdf
                     resonance structures 1 and 3 from the top  reson.pdf                     resonance structures 1 and 3 from the top  reson.pdf
resonance structures 1 and 3 from the top reson.pdfanonakitchen
 
probability = (0.2-0.1)10 = 0.01 ANSWER .pdf
                     probability = (0.2-0.1)10  = 0.01  ANSWER       .pdf                     probability = (0.2-0.1)10  = 0.01  ANSWER       .pdf
probability = (0.2-0.1)10 = 0.01 ANSWER .pdfanonakitchen
 
Molecular solid Solution .pdf
                     Molecular solid Solution                     .pdf                     Molecular solid Solution                     .pdf
Molecular solid Solution .pdfanonakitchen
 
It is methane since there is only 1 Carbon and it.pdf
                     It is methane since there is only 1 Carbon and it.pdf                     It is methane since there is only 1 Carbon and it.pdf
It is methane since there is only 1 Carbon and it.pdfanonakitchen
 
When finding E why did you divide the molar mass of copper by 2.pdf
When finding E why did you divide the molar mass of copper by 2.pdfWhen finding E why did you divide the molar mass of copper by 2.pdf
When finding E why did you divide the molar mass of copper by 2.pdfanonakitchen
 
Thermochemistry is the study of the energy and heat associated with .pdf
Thermochemistry is the study of the energy and heat associated with .pdfThermochemistry is the study of the energy and heat associated with .pdf
Thermochemistry is the study of the energy and heat associated with .pdfanonakitchen
 
Vibration and WavesT = 2pisqrt(mk)v = lambdafp = A sin(kx.pdf
Vibration and WavesT = 2pisqrt(mk)v = lambdafp = A sin(kx.pdfVibration and WavesT = 2pisqrt(mk)v = lambdafp = A sin(kx.pdf
Vibration and WavesT = 2pisqrt(mk)v = lambdafp = A sin(kx.pdfanonakitchen
 
The following steps illustrate how to write a simple Level-2 MATLAB .pdf
The following steps illustrate how to write a simple Level-2 MATLAB .pdfThe following steps illustrate how to write a simple Level-2 MATLAB .pdf
The following steps illustrate how to write a simple Level-2 MATLAB .pdfanonakitchen
 
CO + 2H2 =CH3OH moles of CO = 2528 moles of H2 =.pdf
                     CO + 2H2 =CH3OH moles of CO = 2528 moles of H2 =.pdf                     CO + 2H2 =CH3OH moles of CO = 2528 moles of H2 =.pdf
CO + 2H2 =CH3OH moles of CO = 2528 moles of H2 =.pdfanonakitchen
 
Solution for Q-23a) Pay interest on bank reserve ( The main tool a.pdf
Solution for Q-23a) Pay interest on bank reserve ( The main tool a.pdfSolution for Q-23a) Pay interest on bank reserve ( The main tool a.pdf
Solution for Q-23a) Pay interest on bank reserve ( The main tool a.pdfanonakitchen
 
Cant see the question.. .pdf
                     Cant see the question..                        .pdf                     Cant see the question..                        .pdf
Cant see the question.. .pdfanonakitchen
 
Note 2 Types of variables dataSolutionNote 2 Typ.pdf
Note 2 Types of variables  dataSolutionNote 2 Typ.pdfNote 2 Types of variables  dataSolutionNote 2 Typ.pdf
Note 2 Types of variables dataSolutionNote 2 Typ.pdfanonakitchen
 
Number 2 is false rest all are trueSolutionNumber 2 is false r.pdf
Number 2 is false rest all are trueSolutionNumber 2 is false r.pdfNumber 2 is false rest all are trueSolutionNumber 2 is false r.pdf
Number 2 is false rest all are trueSolutionNumber 2 is false r.pdfanonakitchen
 

More from anonakitchen (20)

1) Current assets = Net working capital + Current liabilities = $1,0.pdf
1) Current assets = Net working capital + Current liabilities = $1,0.pdf1) Current assets = Net working capital + Current liabilities = $1,0.pdf
1) Current assets = Net working capital + Current liabilities = $1,0.pdf
 
-7 & 16Solution-7 & 16.pdf
-7 & 16Solution-7 & 16.pdf-7 & 16Solution-7 & 16.pdf
-7 & 16Solution-7 & 16.pdf
 
(a). The posterior pole of the embryo of drosophila contains essenti.pdf
(a). The posterior pole of the embryo of drosophila contains essenti.pdf(a). The posterior pole of the embryo of drosophila contains essenti.pdf
(a). The posterior pole of the embryo of drosophila contains essenti.pdf
 
As per interest rate parity, Expected.pdf
    As per interest rate parity,                              Expected.pdf    As per interest rate parity,                              Expected.pdf
As per interest rate parity, Expected.pdf
 
With the HNMR the two CH3s are chemically equiv.pdf
                     With the HNMR the two CH3s are chemically equiv.pdf                     With the HNMR the two CH3s are chemically equiv.pdf
With the HNMR the two CH3s are chemically equiv.pdf
 
there is no image .pdf
                     there is no image                               .pdf                     there is no image                               .pdf
there is no image .pdf
 
resonance structures 1 and 3 from the top reson.pdf
                     resonance structures 1 and 3 from the top  reson.pdf                     resonance structures 1 and 3 from the top  reson.pdf
resonance structures 1 and 3 from the top reson.pdf
 
probability = (0.2-0.1)10 = 0.01 ANSWER .pdf
                     probability = (0.2-0.1)10  = 0.01  ANSWER       .pdf                     probability = (0.2-0.1)10  = 0.01  ANSWER       .pdf
probability = (0.2-0.1)10 = 0.01 ANSWER .pdf
 
Molecular solid Solution .pdf
                     Molecular solid Solution                     .pdf                     Molecular solid Solution                     .pdf
Molecular solid Solution .pdf
 
IV II I III .pdf
                     IV  II  I  III                                .pdf                     IV  II  I  III                                .pdf
IV II I III .pdf
 
It is methane since there is only 1 Carbon and it.pdf
                     It is methane since there is only 1 Carbon and it.pdf                     It is methane since there is only 1 Carbon and it.pdf
It is methane since there is only 1 Carbon and it.pdf
 
When finding E why did you divide the molar mass of copper by 2.pdf
When finding E why did you divide the molar mass of copper by 2.pdfWhen finding E why did you divide the molar mass of copper by 2.pdf
When finding E why did you divide the molar mass of copper by 2.pdf
 
Thermochemistry is the study of the energy and heat associated with .pdf
Thermochemistry is the study of the energy and heat associated with .pdfThermochemistry is the study of the energy and heat associated with .pdf
Thermochemistry is the study of the energy and heat associated with .pdf
 
Vibration and WavesT = 2pisqrt(mk)v = lambdafp = A sin(kx.pdf
Vibration and WavesT = 2pisqrt(mk)v = lambdafp = A sin(kx.pdfVibration and WavesT = 2pisqrt(mk)v = lambdafp = A sin(kx.pdf
Vibration and WavesT = 2pisqrt(mk)v = lambdafp = A sin(kx.pdf
 
The following steps illustrate how to write a simple Level-2 MATLAB .pdf
The following steps illustrate how to write a simple Level-2 MATLAB .pdfThe following steps illustrate how to write a simple Level-2 MATLAB .pdf
The following steps illustrate how to write a simple Level-2 MATLAB .pdf
 
CO + 2H2 =CH3OH moles of CO = 2528 moles of H2 =.pdf
                     CO + 2H2 =CH3OH moles of CO = 2528 moles of H2 =.pdf                     CO + 2H2 =CH3OH moles of CO = 2528 moles of H2 =.pdf
CO + 2H2 =CH3OH moles of CO = 2528 moles of H2 =.pdf
 
Solution for Q-23a) Pay interest on bank reserve ( The main tool a.pdf
Solution for Q-23a) Pay interest on bank reserve ( The main tool a.pdfSolution for Q-23a) Pay interest on bank reserve ( The main tool a.pdf
Solution for Q-23a) Pay interest on bank reserve ( The main tool a.pdf
 
Cant see the question.. .pdf
                     Cant see the question..                        .pdf                     Cant see the question..                        .pdf
Cant see the question.. .pdf
 
Note 2 Types of variables dataSolutionNote 2 Typ.pdf
Note 2 Types of variables  dataSolutionNote 2 Typ.pdfNote 2 Types of variables  dataSolutionNote 2 Typ.pdf
Note 2 Types of variables dataSolutionNote 2 Typ.pdf
 
Number 2 is false rest all are trueSolutionNumber 2 is false r.pdf
Number 2 is false rest all are trueSolutionNumber 2 is false r.pdfNumber 2 is false rest all are trueSolutionNumber 2 is false r.pdf
Number 2 is false rest all are trueSolutionNumber 2 is false r.pdf
 

Recently uploaded

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 

Recently uploaded (20)

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 

Please find the required program below with output#include stdio.pdf

  • 1. Please find the required program below with output: #include void transposeMatrix(int arr[][5], int trans[][4]){ for (int j = 0; j < 5; ++j) { for (int i = 0; i < 4; ++i) { trans[j][i] = arr[i][j]; // just reversing the address i,j to j,i so that the transpose will be made } } } void main() { int array[4][5], trans[5][4]; int i, j; printf("Enter the elements of matrix "); for (i = 0; i < 4; ++i) { for (j = 0; j < 5; ++j) { scanf("%d", &array[i][j]); // reading the 4x5 matrix array } } printf("The matrix is "); //just printing the user input array for (i = 0; i < 4; ++i) { for (j = 0; j < 5; ++j) { printf(" %d", array[i][j]); } printf(" ");
  • 2. } transposeMatrix(array,trans); //calling the transposeMatrix method, so that the transpose of the matrix array will be stored in trans printf("Transpose of matrix is "); //just printing the returned transpose matrix trans for (i = 0; i < 5; ++i) { for (j = 0; j < 4; ++j) { printf(" %d", trans[i][j]); } printf(" "); } } --------------------------------------------------------------------------------- OUTPUT: Enter the elements of matrix 1 2 3 4 5 6 7 8
  • 3. 9 10 11 12 13 14 15 16 17 18 19 20 The matrix is 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
  • 4. Transpose of matrix is 1 6 11 16 2 7 12 17 3 8 13 18 4 9 14 19 5 10 15 20 Solution Please find the required program below with output: #include void transposeMatrix(int arr[][5], int trans[][4]){ for (int j = 0; j < 5; ++j) { for (int i = 0; i < 4; ++i) { trans[j][i] = arr[i][j]; // just reversing the address i,j to j,i so that the transpose will be made } } } void main() { int array[4][5], trans[5][4]; int i, j;
  • 5. printf("Enter the elements of matrix "); for (i = 0; i < 4; ++i) { for (j = 0; j < 5; ++j) { scanf("%d", &array[i][j]); // reading the 4x5 matrix array } } printf("The matrix is "); //just printing the user input array for (i = 0; i < 4; ++i) { for (j = 0; j < 5; ++j) { printf(" %d", array[i][j]); } printf(" "); } transposeMatrix(array,trans); //calling the transposeMatrix method, so that the transpose of the matrix array will be stored in trans printf("Transpose of matrix is "); //just printing the returned transpose matrix trans for (i = 0; i < 5; ++i) { for (j = 0; j < 4; ++j) { printf(" %d", trans[i][j]); } printf(" "); } } --------------------------------------------------------------------------------- OUTPUT: Enter the elements of
  • 7. 19 20 The matrix is 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Transpose of matrix is 1 6 11 16 2 7 12 17 3 8 13 18 4 9 14 19 5 10 15 20