Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- void GetMax(int* a, int size, int* max){
- *max = *a;
- int i;
- i=0;
- for (i=1;i<size;i++)
- {
- if ( *max < a[i] ) *max = a[i];
- }
- }
- #define Na 5
- int main()
- {
- int i;
- int a[Na] = {10, 20, -3, 60, 1};
- int max = 0;
- GetMax(&a[0], Na, &max );
- printf( "max: %d\n", max);
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement