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

hi send me sample aptitude papers of cts?

2123


What is the value of uninitialized variable in c?

1001


how to construct a simulator keeping the logical boolean gates in c

2229


Where define directive used?

1058


In C language, a variable name cannot contain?

1244


How can you call a function, given its name as a string?

1119


Explain the priority queues?

1054


What is the use of c language in real life?

996


What are the Advantages of using macro

1144


What is a pointer in c plus plus?

1267


Explain how do you declare an array that will hold more than 64kb of data?

1417


What are the advantages of using linked list for tree construction?

1049


What is the use of pointers in C?

1046


What is difference between constant pointer and constant variable?

1247


How can I run c program?

1143