Created
November 17, 2008 12:15
-
-
Save gnufied/25736 to your computer and use it in GitHub Desktop.
This file contains 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
#include <stdio.h> | |
int find_max(const int *a,const int length) { | |
int i,max = a[0]; | |
for(i = 1; i < length; i++) | |
if(a[i] > max) max = a[i]; | |
return max; | |
} | |
int main() { | |
const int a[] = {10,4,67,12,43,32,12,43,4,5,6}; | |
printf("Maximum number is : %d\n",find_max(a,sizeof(a)/sizeof(int))); | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment