How to write a C program to display the transpose of given 3 X 3 matrix in C Programming Language ?
Solution:
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10][10],b[10][10],i,j;
clrscr();
printf("\nEnter the elements of matrix:");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\nThe Transpose of matrix is:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
b[i][j]=a[j][i];
printf("\t%d\t",b[i][j]);
}
printf("\n");
}
getch();
}
//OUTPUT:
//Enter the elements of matrix:
1 2 3 4 5 6 7 8 9
//The Transpose of matrix is:
1 4 7
2 5 8
3 6 9
Learn More :
Display
- DISPLAY SOURCE CODE AS OUTPUT IN C PROGRAM
- Sort Three Numbers - program reads in three Integers and displays them in ascending order.
- C Program To Display The Number In A Specific Formats
- C Program that Display a IBM Logo
- C program calculates a given function in range given by user, stores the data in arrays and displays the answer in a table.
- LED ON OFF For One Sec/Count and Display on the Attached Serial Monitor
- Pre Order, Post order, In order Implement Binary Tree using linked list
- C Program to accept m*n matrix from user and display the elements of given matrix using function
- C Program to accept n numbers & store all prime numbers in an array & display this result
- C Program to accept a string from user, delete all vowels from that string & display the result
- C Program To Create Two Singly Linked List and Perform Following Operation
- Create Two Singly Linked List Perform Differences Display It C Program
- C Program to Create, Display, Insert and Deletion of Queue Elements
- Creation and Display of Elements in Both Forward and Reverse Direction in a Doubly Linked List
- C Program to Display a real time clock (HH:MM:SS) on the LCD
- Program to Display Pie Chart Accepting User Input C Program
- Linked List For Getting Employee Details, Display and Search For Salary C Program
- Menu driven program in the creation,display,search, insertion and deletion of a node in the linked list
- Program to display the following pattern in C
- Display the Following Pattern * ** *** **** ***** C Program
Tranpose
Matrix
- C Program To Find Transpose Of A Matrix
- C Program To Multiply Two Matrices
- C Program To Print Tridiagonal Matrix
- C Program To Understand Use Of Pointers In MATRIX
- C Program : 4x4 Matrix Keypad connected to Arduino. This code prints the key pressed on the keypad to the serial port.
- C Code/Program For Swap Matrix
- matrix sort in C Program
- Sequential Matrix Multiplication C Program
- C Program to calculate sum of two m*n matrices & store the result in 3 matrix
- C Program to accept m*n matrix from user and display the elements of given matrix using function
- C Program to calculate the sum of elements of upper triangle of a n*n matrix using DMA
- Calculate sum of element of upper triangle of m*n matrix by using dynamic memory allocation
- Calculate sum of non-diagonal element in m*n matrix C Program
- Calculate sum of element of lower triangle of m*n matrix by using dynamic memory allocation
- C Program Shortest Distance in Matrix
- C Program To Read The Adjecancy Matrix of Directed Graph And Convert It Into Adjecancy List
3 x 3
given
- C Program To Find Week Day Of A Given Date
- Give me an integer and I will sum it with the previous natural numbers
- C program calculates a given function in range given by user, stores the data in arrays and displays the answer in a table.
- C Program to Check Given String is Palindrome or Not
- C Program That in a Given Natural Number x Insert Figure c at Position p
- Return the number of tokens given a command
- C Program reads in and spews out the attributes of a given .wav file.
- C Program Recursive function that searches for a given file in a given folder
- C Program to accept m*n matrix from user and display the elements of given matrix using function
- C Program to convert given decimal number into binary number