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

Differentiate between an external iterator and an internal iterator?

985


What is the meaning of c++?

1013


How are the features of c++ different from c?

1077


What is unary operator? List out the different operators involved in the unary operator.

981


What is const pointer and const reference?

1142


How would you use the functions sin(), pow(), sqrt()?

1169


Out of fgets() and gets() which function is safe to use and why?

1174


What is a terminating character in c++?

1371


What is array give example?

1032


What is #include ctype h in c++?

1149


What language is a dll written in?

1015


Why is c++ so fast?

1016


Which is best ide for c++?

1002


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

1060


Is c++ still being used?

1019