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
Explain how can I avoid the abort, retry, fail messages?
What oops means?
What are structure types in C?
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"
What is a function in c?
Is r written in c?
What is the difference between #include and #include 'file' ?
What does stand for?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
What is preprocessor with example?
What is the best way of making my program efficient?
How do you convert strings to numbers in C?
What is define directive?
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
List the different types of c tokens?