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 void pointers in c?
What are the benefits of c language?
What does c mean before a date?
What is indirection? How many levels of pointers can you have?
Suggesting that there can be 62 seconds in a minute?
When should volatile modifier be used?
Is there a way to switch on strings?
What are the types of i/o functions?
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);
How will you write a code for accessing the length of an array without assigning it to another variable?
What is void main ()?
What are the 32 keywords in c?
simple program of graphics and their output display
Why n++ execute faster than n+1 ?
What are header files? What are their uses?