For example:
if we enter
5
7
9
4
3
6
7
8
9
then the above values will be displayed in the form:
5 7 9
4 3 6
7 8 9.
The main source code of the program is given below:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<conio.h> | |
int main() | |
{ | |
int n[3][3]; | |
int a,b; | |
printf("enter values for 3*3 matrix"); | |
for(a=0;a<3;a++) | |
{ | |
for(b=0;b<3;b++) | |
{ | |
scanf("%d",&n[a][b]); | |
} | |
} | |
for(a=0;a<3;a++) | |
{ | |
for(b=0;b<3;b++) | |
{ | |
printf("%d",n[a][b]); | |
} | |
printf("\n"); | |
} | |
getch(); | |
} |
minor mistake, I reckon. return 0; is missing :)
ReplyDeleteTHANKS FOR THE COMMENT
DeleteBut I am afraid you should know what getch(); actually does.
getch(); does the same thing as return 0;