adspace


Write a program that read 2o numbers in and array and
output the second largest number. Can anybody help??

Answer Posted / fahad

#include<iostream.h>
void main()
{
int a[20];
int i;
for(i=o ; i<20 ;i++)
cin>>a[i];
}
int(max=a[0];
for(i=1; i<20; i++)
{
if(a[i]>max) max=a[i];
}
cout<<"\n maimun number is ="<< max<<"\n";
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the latest version on c++?

1217


What character terminates all character array strings a) b) . c) END

1403


Can union be self referenced?

1275


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1172


daily Routine of father

1489