Maximum value from array
Program:
#include <stdio.h>
void main()
{
int arr[10]={10,20,30,40,50,60,70,80,90,100};
int i,max;
max=arr[0];
for(i=1;i<10;i++)
{
if(arr[i]>max)
max=arr[i];
}
printf("Maximum number is: %d",max);
}
Output:
Maximum number is: 100
Drafted on 🌏 by,
Jal
☮
peace
Comments
Post a Comment