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
Why isn't it being handled properly?
Differentiate between Macro and ordinary definition.
What is a function simple definition?
Here is a good puzzle: how do you write a program which produces its own source code as output?
How many parameters should a function have?
Explain what is the general form of a c program?
Write a program to generate random numbers in c?
Can you write a programmer for FACTORIAL using recursion?
What are the advantages of using Unions?
What is getch() function?
What are structures and unions? State differencves between them.
Is there a way to jump out of a function or functions?
What are the standard predefined macros?
How the c program is executed?
What is c definition?