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

What is malloc() function?

638


What is the use of header?

623


What are the types of data types and explain?

669


What is the size of a union variable?

599


Explain do array subscripts always start with zero?

761






How can I recover the file name given an open stream?

556


What is equivalent to ++i+++j?

643


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

603


How can you tell whether a program was compiled using c versus c++?

619


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

1213


What is keyword in c?

604


Explain which function in c can be used to append a string to another string?

590


What is meant by type specifiers?

660


What are void pointers in c?

574


Is struct oop?

581