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
With the help of using classes, write a program to add two numbers.
What is preprocessor with example?
What is a macro?
When we use void main and int main?
difference between Low, Middle, High Level languages in c ?
Write the Program to reverse a string using pointers.
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
Explain what is the general form of a c program?
Why c language is called c?
Should a function contain a return statement if it does not return a value?
How reliable are floating-point comparisons?
What is the difference between char array and char pointer?
What the different types of arrays in c?
Why c is a procedural language?
What is ambagious result in C? explain with an example.