largest elemet in array-asr
largest elemet in array C program
/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
int main()
{
int i,n,a[20],max;
printf("enter any number");
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
max=a[0];
for(i=1;i<n;i++){
if(max<a[i]){
max=a[i];
}
}
printf("%d",max);
return 0;
}
Comments
Post a Comment