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
How can I generate floating-point random numbers?
What is scope and lifetime of a variable in c?
Is a pointer a kind of array?
How can I write a function analogous to scanf?
What does the error 'Null Pointer Assignment' mean and what causes this error?
What is variable and explain rules to declare variable in c?
What is signed and unsigned?
What is the difference between local variable and global variable in c?
Explain continue keyword in c
any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above
Without Computer networks, Computers will be half the use. Comment.
difference between object file and executable file
Is swift based on c?
Explain two-dimensional array.
write a progrmm in c language take user interface generate table using for loop?