Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / sujeet pardeshi

int k;
for(i=0;i<2;i++)
{
max=0;
for(j=n;j>=i;j--)
{
if(a[j]>max)
{
max=a[j];
k=j;
}
}
swap(a[i],a[k]);
}
printf("2nd highest no is:%d",max);

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is recursion?

1944


What does the following code do: int c=0; cout< a) Undefined *Updated* b) 01 c) 00

1016


What is vector pair in c++?

1176


What is a storage class?

1183


What is the use of register keyword with the variables?

898


Why cout is used in c++?

981


what is oops and list its features in c++?

999


write asingle linked list which read from two list & the do the following 1 sort the prime & nonprime num (prime should be less tn nonprime) 2 each node has a prime num followd by nonprime 3 add a new node into its sutable plce 4 erase the most three duplicated non prime num 5 find the least duplicated prime num

2584


List the features of oops in c++?

991


What is prototype in c++ with example?

1055


What does it mean to declare a destructor as static?

1020


What is malloc in c++?

973


Explain how functions are classified in C++ ?

1180


What is flush programming?

954


Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;

1966