1.find the second maximum in an array?
2.how do you create hash table in c?
3.what is hash collision
Answer Posted / sachin
1.#include<stdio.h>
int main()
{
int a[10]={222,111,4,5,6,8,1,77,0,4};
int i=0,max=0,sec_max=0;
for(i=0;i<10;i++)
{
if(a[i]>max)
{
sec_max=max;
max=a[i];
}
else if(a[i]>sec_max)
{
sec_max=a[i];
}
}
printf("Max= %d Second Max=%d",max,sec_max);
}
| Is This Answer Correct ? | 23 Yes | 2 No |
Post New Answer View All Answers
What does the c preprocessor do?
What is variables in c?
What is the function of this pointer?
ATM machine and railway reservation class/object diagram
What are the general description for loop statement and available loop types in c?
what type of questions arrive in interview over c programming?
What is the code for 3 questions and answer check in VisualBasic.Net?
Is stack a keyword in c?
Is main an identifier in c?
What are the different types of control structures?
Explain the binary height balanced tree?
Why string is used in c?
What is meant by int main ()?
I have a varargs function which accepts a float parameter?
Can a program have two main functions?