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
What is the maximum no. of arguments that can be given in a command line in C.?
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
Can include files be nested?
Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff
How to write a code for reverse of string without using string functions?
What is || operator and how does it function in a program?
What is a constant?
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
Is main is a keyword in c?
What is character set?
How can I find the modification date and time of a file?
What is signed and unsigned?
which type of aspect you want from the student.
What is table lookup in c?