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
What is malloc() function?
What is the use of header?
What are the types of data types and explain?
What is the size of a union variable?
Explain do array subscripts always start with zero?
How can I recover the file name given an open stream?
What is equivalent to ++i+++j?
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.
How can you tell whether a program was compiled using c versus c++?
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.
What is keyword in c?
Explain which function in c can be used to append a string to another string?
What is meant by type specifiers?
What are void pointers in c?
Is struct oop?