2.Find the maximum and minimum element in an array?write a program in any language? Get link Facebook X Pinterest Email Other Apps November 11, 2020 Get link Facebook X Pinterest Email Other Apps Comments UnknownNovember 12, 2020 at 7:07 AMint main(){int a[10],i,max;for(i=0;i<10;i++){printf("Enter the N0.");scanf("%d",&a[i]);}max = a[0];for(i=0;i<10;i++)if(a[i]>max)max=a[i];printf("\Max Number is %d",max);return 0;}ReplyDeleteRepliesAnkitNovember 12, 2020 at 7:18 AMonly for max no.DeleteRepliesReplyReplyAdd commentLoad more... Post a Comment
int main(){
ReplyDeleteint a[10],i,max;
for(i=0;i<10;i++)
{
printf("Enter the N0.");
scanf("%d",&a[i]);
}
max = a[0];
for(i=0;i<10;i++)
if(a[i]>max)
max=a[i];
printf("\Max Number is %d",max);
return 0;
}
only for max no.
Delete