Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1 big
- //1.1
- #include<stdio.h>
- int maxValue(int Matrix[4][3]);
- int main(){
- int num[4][3];
- int max;
- int i,j;
- printf("Enter elements of Matrix M[4x3]\n");
- for(i=0;i<4;i++){
- for(j=0;j<3;j++){
- printf("M[%d][%d]:",i+1,j+1);
- scanf("%d",&num[i][j]);
- }
- }
- max=maxValue(num);
- printf("%d",max);
- return 0;
- }
- int maxValue(int Matrix[4][3]){
- int x;
- int i=0,j=0;
- x = Matrix[0][0];
- for(i=0;i<4;i++){
- for(j=0;j<3;j++){
- if(Matrix[i][j]>x){
- x=Matrix[i][j];
- }
- }
- }
- return x;
- }
Advertisement
Add Comment
Please, Sign In to add comment