Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void max_Matrix(int a[10][10],int b[10][10],int c[10][10],int m,int n)
- {
- int i,j;
- for(i=0;i<m;i++)
- {
- for(j=0;j<n;j++)
- {
- if(a[i][j]>b[i][j])
- {
- c[i][j]=a[i][j];
- }
- else if (b[i][j]>a[i][j])
- {
- c[i][j]=b[i][j];
- }
- }
- }
- for(i=0;i<m;i++)
- {
- for(j=0;j<n;j++)
- {
- printf("%d",&c[i][j]);
- printf("\n");
- }
- }
- }
- int main()
- {
- int A[10][10];
- int B[10][10];
- int C[10][10];
- int s,f;
- int i,j;
- for(i=0;i<s;i++)
- {
- for(j=0;j<f;j++)
- {
- scanf("%d",&A[i][j]);
- }
- }
- for(i=0;i<s;i++)
- {
- for(j=0;j<f;j++)
- {
- scanf("%d",&B[i][j]);
- }
- }
- max_Matrix(A,B,C,s,f);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment