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 logical errors? Compare with syntax errors.

719


What is the difference between array and structure in c?

664


Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

760


Write a program on swapping (100, 50)

762


What are the different types of objects used in c?

657






What is the difference between class and object in c?

673


What are the types of data types and explain?

754


Write a program with dynamically allocation of variable.

708


What functions are used in dynamic memory allocation in c?

690


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

3332


Write a program to reverse a linked list in c.

745


What is return in c programming?

622


What is meant by type casting?

721


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

863


What is dynamic dispatch in c++?

651