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

Popular posts from this blog

aaabb to32 ,aabbb to a2b3 convert in c-asr

a2b3 output aabbb c program and beautiful use of getchar() ,isdigit() ,atoi() functions and stdlib.h header file-asr

C program to print square spiral number pattern - asr