TRANSPOS - temp=mat[a][3-b]; mat[a][3-b]=mat[3-b][a];...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<stdio.h> #include<conio.h> #define F1 for(a=0;a<3;a++) #define F2 for(b=0;b<3;b++) void main (void) { int mat[3][3]; int a,b,temp; clrscr(); printf("Enter the matrix of order 3 x 3:\n"); F1 { F2 { printf("Enter the value %d%d:",a+1,b+1); scanf("%d",&mat[a][b]); } } F1 { for(b=3;b>=0;b--) { if(a+b>=4) {
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: temp=mat[a][3-b]; mat[a][3-b]=mat[3-b][a]; mat[3-b][a]=temp; } } } clrscr(); printf("Transpose of matrix is:\n"); F1 { F2 { printf(" %d\t",mat[a][b]); } printf("\n"); } for(a=1;a<=3;a++) { gotoxy(1,a+1); printf("\xb3"); gotoxy(21,a+1); printf("\xb3"); } getch(); }...
View Full Document

This note was uploaded on 11/06/2010 for the course UBIT 411 taught by Professor Saleemelahi during the Spring '10 term at University of Karachi.

Ask a homework question - tutors are online