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
How can I avoid the abort, retry, fail messages?
What is scanf () in c?
What is the difference between void main and main in c?
What is the value of uninitialized variable in c?
Why we not create function inside function.
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
What is the purpose of sprintf() function?
What are the preprocessor categories?
Differentiate between full, complete & perfect binary trees.
What is string in c language?
Does sprintf put null character?
How to declare pointer variables?
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...
Explain how can you check to see whether a symbol is defined?
What is the meaning of typedef struct in c?