1.find the second maximum in an array?
2.how do you create hash table in c?
3.what is hash collision
Answer Posted / jaypal rajput
//find second maximum number in given array.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a[5];
int max=0,secmax=0,i;
cout<<"Enter element";
for(i=0;i<=4;i++)
{
cin>>a[i];
}
for(i=0;i<=4;i++)
{
if(a[i]>max)
{
secmax=max;
max=a[i];
}
if(a[i]>secmax&&a[i]<max)
{
secmax=a[i];
}
}
cout<<"The max element is="<<max;
cout<<"the sec max is="<<secmax;
getch();
}
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
Are pointers integer?
Is the exit() function same as the return statement? Explain.
What does *p++ do?
Explain what is a const pointer?
What are the parts of c program?
in iso what are the common technological language?
What are the uses of a pointer?
Why c is called object oriented language?
What is the scope of an external variable in c?
What is openmp in c?
Write the Program to reverse a string using pointers.
praagnovation
Explain what is a stream?