Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<math.h>
- #include<stdlib.h>
- #include<stdio.h>
- #include<conio.h>
- int main()
- {
- int i,j,n,m,imax;
- float A[10][10];
- printf("enter size of array nxm\n");
- scanf("%d %d",&n,&m);
- for(j=0;j<m;j++)
- {for(i=0;i<n;i++)
- {A[i][j]=0+random(99);
- printf("| %2.f |", A[i][j]);}
- printf("\n");}
- for(j=0;j<m;j++)
- {imax=0;
- for(i=0;i<n;i++)
- if(A[i][j]>A[imax][j]) imax=i;
- else continue;
- for(i=imax;i<n-1;i++)
- A[i][j]=A[i+1][j];
- A[i][j]=0;}
- printf("\n");
- for(j=0;j<m;j++)
- {for(i=0;i<n;i++)
- printf("| %2.f |", A[i][j]);
- printf("\n");}
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement