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
What is malloc return c?
formula to convert 2500mmh2o into m3/hr
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
Explain what is meant by 'bit masking'?
Explain main function in c?
Was 2000 a leap year?
Explain about the constants which help in debugging?
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
Explain argument and its types.
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
What is the function of this pointer?
What is the difference between array and pointer in c?
What is the time and space complexities of merge sort and when is it preferred over quick sort?
State the difference between x3 and x[3].
What is type qualifiers?