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

ques-Input an array and prints the second minimum in an array??
Example
Input:34,45,21,12,54,67,15
Output:15
I want a solution in C/C++ language

Answer Posted / amit rawat

#include<iostream.h>
#include<conio.h>
void main()
{clrscr();
int ar[6]={21,23,14,65,2,35};
for(int i=0;i<6;i++)
{for(int j=0;j<i;j++)
{if(ar[i]<ar[j])
{int min=ar[i];
ar[i]=ar[j];
ar[j]=min;
}
}
}
cout<<"\n";
cout<<ar[1]<<"is the second lowest no";
getch();

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Ram starts from A walking 2 km North and turns right and walks 4 km and turns right again and walks 4 km and turns right again and walks 4 km and meets Radha at Bwalking in the opposite direction to Ram . Distance between A and B

1527


Two trains at speed 60 km/hr come in the opposite direction. At a particular time the distance between the two trains is 18km. A shuttle flies between the trains at the speed of 80 km/hr. At the time the two trains crashes what is the distance traveled by shuttle?

1308


A guy shows his friend a girl standing in front of her in a hotel and says that she is the daughter of my granny's only son. How are they two related?

1280


Find the next series of 1,2,2,4,8,?

1297


Can you tender a one rupee note in such a manner that there shall be total 50 coins but none of them would be 2 paise coins.?

1488


In a fraction, if 1 is added to both the numerator at the denominator, the fraction becomes 1/2. If numerator is subtracted from the denominator, the fraction becomes 3/4. Find the fraction.

1173


There are coins of Rs.5, 2, 1,50p, 25p, 10p, 5p. each one has got a weight. Rs 5 coin weighs 20gms.find the minimum number of coins to get a total of 196.5gms.

1427


2 oranges,3 bananas and 4 apples cost Rs.15 . 3 ornages 2 bananas 1 apple costs Rs 10. what is the cost of 3 oranges, 3 bananas and 3 apples

1292


The difference b/w the compound interest payble half yearly and the simple interest on a certain sum lent out at 10% p.a for 1 year is Rs 25. What is the sum?

1306


Imagine a rectangle.Its length=2*width.A square of 1 inch is cut on all corners so that the remaining portion forms a box when folded.the volume of the box is_____ cubic inches.find the original dimensions of the box.

1288


If Rs.1260 is divided between between A, B and C in the ratio 2:3:4, what is C's share?

1637


If the bus travels with 8 tyres(6 tyres running),travels a distance of 16000 km how much is the distance sustained by each tyre.

2424


A car is traveling at a uniform speed. The driver sees a milestone showing a 2-digit number. After traveling for an hour the driver sees another milestone with the same digits in reverse order. After another hour the driver sees another milestone containing the same two digits. What is the average speed of the driver.

1177


After spending 2/3 of his salary on rent and food items and 1/4th of the remaining on transportation, Rajesh has 6000 with him. How much did he pay on transportation?

2392


If a bank clerk can process 80 drafts in half an hour, how many drafts can she process in seven and half hour day?

1200