Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * prog.c
- *
- * Created on: Sep 29, 2016
- * Author: dastan.iyembergen
- */
- #include <stdio.h>
- double maxVal(int len, double arr[len][len]){
- int i, j;
- double max;
- for (i=0; i<len; i++){
- for (j=0; j<len; j++){
- if ((i==0 && j==0) || max<arr[i][j]) {
- max=arr[i][j];
- }
- }
- }
- return max;
- }
- int main(){
- double arr[3][3]={{456, 45.2, 4688},
- {48, 86.2, 2.3},
- {48, 48.3, 4},
- };
- printf("%f", maxVal(3, arr));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment