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


Please Help Members By Posting Answers For Below Questions

Define VARIABLE?

686


Can you mix old-style and new-style function syntax?

660


What is a keyword?

740


Is c easier than java?

567


Are there constructors in c?

590






Why doesnt the call scanf work?

665


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.

679


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);

1349


What is binary tree in c?

617


What is the importance of c in your views?

586


Is c high or low level?

577


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

643


Difference between MAC vs. IP Addressing

637


What is your stream meaning?

603


how to write a c program to print list of fruits in alpabetical order?

1786