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 / sachin

1.#include<stdio.h>
int main()
{
int a[10]={222,111,4,5,6,8,1,77,0,4};
int i=0,max=0,sec_max=0;

for(i=0;i<10;i++)
{
if(a[i]>max)
{
sec_max=max;
max=a[i];
}
else if(a[i]>sec_max)
{
sec_max=a[i];
}


}

printf("Max= %d Second Max=%d",max,sec_max);

}

Is This Answer Correct ?    23 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does the c preprocessor do?

1100


What is variables in c?

1045


What is the function of this pointer?

1324


ATM machine and railway reservation class/object diagram

5239


What are the general description for loop statement and available loop types in c?

1114


what type of questions arrive in interview over c programming?

2022


What is the code for 3 questions and answer check in VisualBasic.Net?

2152


Is stack a keyword in c?

1078


Is main an identifier in c?

1141


What are the different types of control structures?

1040


Explain the binary height balanced tree?

1178


Why string is used in c?

999


What is meant by int main ()?

1200


I have a varargs function which accepts a float parameter?

1034


Can a program have two main functions?

1113