#include<MKL25Z4.h>
int main()
{
volatile unsigned int size,i,k=0xFFFFFFFF,t=0; // t stores max number , k store min number
volatile unsigned int z[]={0x04,0x0A,0x01,0x02,0x0F}; // data taken in array
size = z[0]; // take size from first location
for (i=1;i<=size;i++)
{
if (t<z[i]) { t=z[i]; } // find maximum
if (k>z[i]) { k=z[i]; } // find minimum
}
}
Input:
Result:
No comments:
Post a Comment