Created
March 17, 2013 22:11
-
-
Save austa/5183868 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /* | |
| * File: main.c | |
| * Author: alaattin | |
| * | |
| * Created on 17 Mart 2013 Pazar, 23:43 | |
| */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #define SATIR 3 | |
| #define SUTUN 3 | |
| /* | |
| * | |
| */ | |
| void matris_Al(int [][3], int, int); | |
| int matris_max(int [][3], int, int); | |
| int main(int argc, char** argv) { | |
| int matris [SATIR][3]; | |
| matris_Al(matris, SATIR, SUTUN); | |
| printf("Matrisin en büyük sayısı: %d 'dir.", matris_max(matris, SATIR, SUTUN)); | |
| return (EXIT_SUCCESS); | |
| } | |
| void matris_Al(int matris[][3], int satirsayisi, int sutunsayisi){ | |
| int i = 0, j = 0; | |
| for(i = 0; i < satirsayisi; i++){ | |
| for(j = 0; j < sutunsayisi; j++){ | |
| printf("Eleman giriniz: \n"); | |
| scanf("%d", &matris[i][j]); | |
| } | |
| } | |
| } | |
| int matris_max(int matris[][3], int satirsayisi, int sutunsayisi){ | |
| int i = 0, j = 0, buyukSayi = 0; | |
| buyukSayi = matris[0][0]; | |
| for(i = 0; i < satirsayisi; i++){ | |
| for(j = 0; j < sutunsayisi; j++){ | |
| if (matris[i][j] > buyukSayi ){ | |
| buyukSayi = matris[i][j]; | |
| } | |
| } | |
| } | |
| return buyukSayi; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment