int a[10]={0,1,2,3,4,5,6,7,8,9}; int i=0,*p=&a[0],*q=p; while(i<10) { if(*p<*q) { p=q; } i++; q++; } printf("max=%d\n",*p);
#include <stdio.h> int main (void) { int a[10]={12,6,5,4,3,2,1,7,8,19}; int *p=a,max=*p; for(;p<a+10;p++) if(*p>max) max=*p; printf("%i\n",max); return 0; }