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
Is return a keyword in c?
Can include files be nested?
Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?
Why is not a pointer null after calling free?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
How does #define work?
How will you find a duplicate number in a array without negating the nos ?
What does void main return?
write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)
what is uses of .net
write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.
I need a sort of an approximate strcmp routine?
Are comments included during the compilation stage and placed in the EXE file as well?
What are header files in c?
What is data structure in c language?