C program to find biggest number from array

Program in the C programming language to find the biggest element or number from the array of any size. Below is the code of the C program –

/* C program to find the biggest element or no. from the array */
#include<stdio.h>
#include<conio.h>
void main()
{
     int ar[100],big,i,n;
     
     printf("Enter the size of the array to input the elements \n");
     scanf("%d",&n);
     
     printf("Enter the elements of the array \n");
     for(i=0;i<n;i++)
     {
           scanf("%d",&ar[i]);
     }
     
     big=ar[0];
     for(i=0;i<n;i++)
     {
           if(ar[i]>=big)
           {
                 big=ar[i];
           }
     }
     printf("Largest number of the array is %d",big);
     getch();
}

yashan has written 69 articles

2 thoughts on “C program to find biggest number from array

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>