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
Define VARIABLE?
Can you mix old-style and new-style function syntax?
What is a keyword?
Is c easier than java?
Are there constructors in c?
Why doesnt the call scanf work?
Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
What is binary tree in c?
What is the importance of c in your views?
Is c high or low level?
A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles
Difference between MAC vs. IP Addressing
What is your stream meaning?
how to write a c program to print list of fruits in alpabetical order?