11:21 AM
C++ Program to find LARGEST NUMBER IN AN ARRAY

Write a Program to find LARGEST NUMBER IN AN ARRAY

#include<iostream.h> 

#include<conio.h>
 
void main()
{
int a[50],size,i,big;
clrscr();
printf("\nEnter the size of the array: ");
scanf("%d",&size);
printf("\nEnter %d elements in to the array: ”, size);
for(i=0;i<size;i++)
scanf("%d",&a[i]);
big=a[0];
for(i=1;i<size;i++)
{
if(big<a[i])
big=a[i];
}
printf("\nBiggest: %d",big);
getch();
}
 
 
Note:
      If you want to change in this program please write through the comment on this page. you can also past similar program 
                 of c++ with output.your comment is valuable to the other user and person.
Views: 97 | Added by: vijoriya | Tags: find, Number, Largest, array, c++, program | Rating: 0.0/0
Total comments: 0
avatar