1: #include<stdio.h>
2: #include<conio.h>
3: void main()
4: {
5: float x[10][10];
6: int i,j,nr,nc;
7: printf("Enter the num of rows:\n");
8: scanf("%d",&nr);
9: printf("Enter the num of columns:\n");
10: scanf("%d",&nc);
11: printf("Enter the elements of matrix:\n");
12: for(i=0;i<nr;i++)
13: {
14: for(j=0;j<nc;j++)
15: {
16: scanf("%f",&x[i][j]);
17: }
18: printf("\n");
19: }
20: printf("The matrix is:\n\n");
21: for(i=0;i<nr;i++)
22: {
23: for(j=0;j<nc;j++)
24: {
25: printf("%.2f ",*(*(x+i)+j));
26: }
27: printf("\n");
28: }
29: getch();
30: }
No comments:
Post a Comment