1.find the second maximum in an array?
2.how do you create hash table in c?
3.what is hash collision
Answer Posted / shanthi
#include<stdio.h>
int main()
{
int array[5]={2,3,4,6,5};
int max=a[0];
int sec=a[1];
for(i=0;i<5;i++)
{
if(a[i]>max)
max=a[i];
}
for(i=0;i<5;i++)
{
if((a[i]>sec )&&(a[i]<max))
{
sec=a[i];
}
}
printf("%d %d",max,sec);
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the sizeof () operator?
Write a program to check whether a number is prime or not using c?
What is declaration and definition in c?
Explain the difference between exit() and _exit() function?
What are logical errors and how does it differ from syntax errors?
Do array subscripts always start with zero?
What is putchar() function?
What is the significance of scope resolution operator?
What is use of null pointer in c?
Between macros and functions,which is better to use and why?
Why array is used in c?
What are lookup tables in c?
What is sizeof array?
What is call by value in c?
What is the difference between if else and switchstatement