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 is a method in c?
How pointer is different from array?
What does it mean when a pointer is used in an if statement?
Mention four important string handling functions in c languages .
What is the use of function overloading in C?
How do you search data in a data file using random access method?
hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm
What are the rules for the identifier?
Why do we use header files in c?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
How are variables declared in c?
What is d scanf?
Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1
Is null equal to 0 in sql?
What are the uses of a pointer?