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 are the advantages of union?
What is restrict keyword in c?
In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above
Can you add pointers together? Why would you?
What are c identifiers?
Differentiate Source Codes from Object Codes
What are c header files?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
Can a local variable be volatile in c?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel
any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above
If null and 0 are equivalent as null pointer constants, which should I use?
Is c is a middle level language?