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...

1.find the second maximum in an array?
2.how do you create hash table in c?
3.what is hash collision

Answer Posted / jaypal rajput

//find second maximum number in given array.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a[5];
int max=0,secmax=0,i;
cout<<"Enter element";
for(i=0;i<=4;i++)
{
cin>>a[i];
}
for(i=0;i<=4;i++)
{
if(a[i]>max)
{
secmax=max;
max=a[i];
}
if(a[i]>secmax&&a[i]<max)
{
secmax=a[i];
}
}
cout<<"The max element is="<<max;
cout<<"the sec max is="<<secmax;
getch();
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the salient features of c languages?

1137


What is 'bus error'?

1208


hi, which software companys will take,if d candidate's % is jst 55%?

2139


What are the properties of union in c?

1110


What is the maximum length of an identifier?

1231


What are loops c?

1098


What is string length in c?

1158


1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321

3781


ATM machine and railway reservation class/object diagram

5307


Write a code to generate a series where the next element is the sum of last k terms.

1287


What is a structure member in c?

1050


What is the difference between call by value and call by reference in c?

1212


What is const and volatile in c?

1094


What is the difference between void main and main in c?

1205


What is a struct c#?

1098