Skip to content

C program to find biggest number from array

by yashan on February 16th, 2012

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();
}

One Comment
  1. thank you for arrays largest numbre

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS