English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2 answers

c++ program for this problem:

void main()
{
int arr[10],i,max,loc;
cout<<"\nEnter any 10 numbers : ";
for(i=0;i<10;i++)
cin>>arr[i];

max=arr[0];
loc=1;
for(i=1;i<10;i++)
{
if(arr[i]>max)
{max=arr[i]; loc=i+1;}
}

cout<<"\nThe largest element is "< }

2007-10-28 00:55:01 · answer #1 · answered by sim 4 · 0 0

void main()
{
snt arr[10],s,max,loc;
count<<"\nPlease enter 10 numbers : ";
for(s=0;s<10;s++)
cin>>arr[s];

max=arr[0];
loc=1;
for(s=1;s<10;s++)
{
sf(arr[s]>max)
{max=arr[s]; loc=s+1;}
}

count<<"\nThe largest element is "<
}
you are going to get the largest element in this Array

2007-10-28 01:09:16 · answer #2 · answered by Mag 7 · 0 0

fedest.com, questions and answers