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 are qualifiers in c?
Is r written in c?
Tell me the use of bit field in c language?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
What is modifier & how many types of modifiers available in c?
Explain how can type-insensitive macros be created?
What are the types of data structures in c?
Is fortran faster than c?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
Write a Program to accept different goods with the number, price and date of purchase and display them
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above
What is the benefit of using const for declaring constants?
C language questions for civil engineering
Write a program of advanced Fibonacci series.
What are the rules for identifiers in c?