Tuesday, December 8, 2009

C++->BIGGEST NUMBER

Write a program to store n numbers into an array and find the biggest number along with its position
#include

#include

void main()

{

int ar[100],i,n,big;

cout<<”Enter how many elements : “;

cin>>n;

cout<<”Enter the elements \n”;

for(i=0;i
cin>>ar[i];











big=ar[0];

for(i=1;i
if(ar[i]>big)

big=ar[i];

cout<<”Biggest number is : “<
getch();

}

0 comments:

Post a Comment

Followers