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

Answer Posted / shanthi

#include<stdio.h>

int main()
{
int array[5]={2,3,4,6,5};
int max=a[0];
int sec=a[1];
for(i=0;i<5;i++)
{
if(a[i]>max)
max=a[i];
}

for(i=0;i<5;i++)
{
if((a[i]>sec )&&(a[i]<max))
{
sec=a[i];
}
}
printf("%d %d",max,sec);
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how can I avoid the abort, retry, fail messages?

583


What oops means?

576


What are structure types in C?

660


Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"

1578


What is a function in c?

567






Is r written in c?

722


What is the difference between #include and #include 'file' ?

602


What does stand for?

590


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

647


What is preprocessor with example?

578


What is the best way of making my program efficient?

561


How do you convert strings to numbers in C?

705


What is define directive?

634


write a c program to print the next of a particular no without using the arithmetic operator or looping statements?

3179


List the different types of c tokens?

619