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

HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????

2263


What are the string functions? List some string functions available in c.

600


What are types of functions?

559


Why is a semicolon (;) put at the end of every program statement?

621


What are multidimensional arrays?

656






Explain how can I manipulate strings of multibyte characters?

778


What is the use of typedef in c?

577


Why do we need arrays in c?

577


Why is it important to memset a variable, immediately after allocating memory to it ?

1550


how is the examination pattern?

1595


What is a volatile keyword in c?

634


What is the hardest programming language?

663


Define Spanning-Tree Protocol (STP)

638


why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???

1514


What are the advantage of c language?

548