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...

write a program to fined second smallest and largest element
in a given series of elements (without sorting)

Answer Posted / sachin tyagi

void main()
{
int a[12],max,min1.min2,max2,i,temp;
printf("enter valu");
for(i=0;i<11;i++)
scanf(%d,&a[i]);
max=a[0];
min1=a[0];
for(i=1;i<11;i++)
{
if(max<a[i])
max=a[i];
if(min1>a[i];
min1=a[i]
}
for(i=1;i<11;i++0
{
if((max2>a[i])&&(max2!=max){
max2=a[i];
}
if((min2<a[i])&&(min2!=min1))
{
min2=a[i];}

print("small is %d and large is %d", min2,max2);
}

Is This Answer Correct ?    15 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you write the function prototype, definition and mention the other requirements.

1146


How can I call a function with an argument list built up at run time?

1249


Which built-in library function can be used to match a patter from the string?

1309


What is atoi and atof in c?

1090


how to capitalise first letter of each word in a given string?

1936


How main function is called in c?

1135


Are there constructors in c?

1017


What is extern storage class in c?

1007


Are pointers integers in c?

1084


Is c++ based on c?

1083


What is the size of enum in bytes?

1092


i have a written test for microland please give me test pattern

2740


Is multithreading possible in c?

1023


Explain null pointer.

1131


What do you understand by normalization of pointers?

1068