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

Answer Posted / rao

#include<stdio.h>

int main()
{
int arr[] = {2,3,20,7,8,1};
int max, sec;
int i;
max=0;
sec=0;
for ( i=0; i< 6; i++)
{
if(arr[i] > max)
max = arr[i];
}

for ( i=0; i< 6; i++)
{
if ( (arr[i] > sec) && (arr[i] < max))
sec = arr[i];
}
printf(" max=%d\n sec=%d\n", max, sec);
}

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is malloc return c?

593


formula to convert 2500mmh2o into m3/hr

491


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

651


Explain what is meant by 'bit masking'?

638


Explain main function in c?

617






Was 2000 a leap year?

620


Explain about the constants which help in debugging?

843


i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical

1836


Explain argument and its types.

592


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

623


What is the function of this pointer?

666


What is the difference between array and pointer in c?

569


What is the time and space complexities of merge sort and when is it preferred over quick sort?

671


State the difference between x3 and x[3].

648


What is type qualifiers?

653