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

What will be your course of action for a push operation?

1074


Whats s or c mean?

968


What functions are used in dynamic memory allocation in c?

1039


What are the types of i/o functions?

1291


Why is c so popular?

1130


Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?

1096


Can a pointer be null?

993


Can a variable be both const and volatile?

1094


Why do we use pointer to pointer in c?

1041


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

1087


How to delete a node from linked list w/o using collectons?

2742


What is string function in c?

962


What are two dimensional arrays alternatively called as?

1155


What is the benefit of using const for declaring constants?

1008


In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping

1450