1.find the second maximum in an array?
2.how do you create hash table in c?
3.what is hash collision
Answer Posted / sachin
1.#include<stdio.h>
int main()
{
int a[10]={222,111,4,5,6,8,1,77,0,4};
int i=0,max=0,sec_max=0;
for(i=0;i<10;i++)
{
if(a[i]>max)
{
sec_max=max;
max=a[i];
}
else if(a[i]>sec_max)
{
sec_max=a[i];
}
}
printf("Max= %d Second Max=%d",max,sec_max);
}
| Is This Answer Correct ? | 23 Yes | 2 No |
Post New Answer View All Answers
What is bash c?
What is a header file?
What are inbuilt functions in c?
What are the modifiers available in c programming language?
how to capitalise first letter of each word in a given string?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
What will the preprocessor do for a program?
please give me some tips for the placement in the TCS.
Which is an example of a structural homology?
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
What is operator promotion?
If you know then define #pragma?
How can I find out how much free space is available on disk?
what will be maximum number of comparisons when number of elements are given?
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.