Learn C Language from the Best Tutors
Search in
// C program to rotate a matrix by 180 degrees
#include <stdio.h>
#define N 3
// Function to Rotate the matrix by 180 degree
void rotateMatrix(int mat[][N])
{
// Simply print from last cell to first cell.
for (int i = N - 1; i >= 0; i--) {
for (int j = N - 1; j >= 0; j--)
printf("%d ", mat[i][j]);
printf("\n");
}
}
// Driven code
int main()
{
int mat[N][N] = {
{ 1, 2, 3 },
{ 4, 5, 6 },
{ 7, 8, 9 }
};
rotateMatrix(mat);
return 0;
}
Related Questions
Program to accept a list of elements and find the maximum number in the list.
Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com
Ask a QuestionRecommended Articles
Lasya Infotech: An educational Training...
Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...
Brilliant Academy, a reputed B. Tech Tuition...
Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...
Why Should you Become an IT Consultant
Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...
8 Hottest IT Careers of 2014!
Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...
Looking for C Language Classes?
Learn from the Best Tutors on UrbanPro
Are you a Tutor or Training Institute?
Join UrbanPro Today to find students near youThe best tutors for C Language Classes are on UrbanPro
The best Tutors for C Language Classes are on UrbanPro