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

With the help of using classes, write a program to add two numbers.

619


What is preprocessor with example?

587


What is a macro?

657


When we use void main and int main?

588


difference between Low, Middle, High Level languages in c ?

1634






Write the Program to reverse a string using pointers.

617


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

729


Explain what is the general form of a c program?

624


Why c language is called c?

571


Should a function contain a return statement if it does not return a value?

597


How reliable are floating-point comparisons?

630


What is the difference between char array and char pointer?

525


What the different types of arrays in c?

614


Why c is a procedural language?

584


What is ambagious result in C? explain with an example.

2057