Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

1.find the second maximum in an array?
2.how do you create hash table in c?
3.what is hash collision

Answer Posted / rao

#include<stdio.h>

int main()
{
int arr[] = {2,3,20,7,8,1};
int max, sec;
int i;
max=0;
sec=0;
for ( i=0; i< 6; i++)
{
if(arr[i] > max)
max = arr[i];
}

for ( i=0; i< 6; i++)
{
if ( (arr[i] > sec) && (arr[i] < max))
sec = arr[i];
}
printf(" max=%d\n sec=%d\n", max, sec);
}

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are qualifiers in c?

1089


Is r written in c?

1189


Tell me the use of bit field in c language?

1108


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

1106


What is modifier & how many types of modifiers available in c?

1074


Explain how can type-insensitive macros be created?

1044


What are the types of data structures in c?

1212


Is fortran faster than c?

1082


Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

1192


Write a Program to accept different goods with the number, price and date of purchase and display them

6296


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

1304


What is the benefit of using const for declaring constants?

1104


C language questions for civil engineering

1766


Write a program of advanced Fibonacci series.

1205


What are the rules for identifiers in c?

1122