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

A gardener plants 100 meters towards east, next 100 meters towards north,next 100 meters towards west. 98 meters towards east, 96 meters towards north and 96 meters towards west, 94 meters towards south. and 94 meters towards east and so on. If a person walks between the trees what is the total distance travelled by him before he reaches the center.

1333


10 : 4 seconds :: ? : 6 minutes

1386


A pipe can fill a tank in 30 min B can fill in 28 min then if 3/4 th of tank can be filled by B pipe and after wards bothare opened then how much time is required by both the pipes to fill the tank completely. note: the values of A and B may slitely vary be ware.

1290


3 red and 4 blue balls are in a basket. A member of PPTeam is drawing balls from the basket.What is the probablity of getting the 3 red balls simultaneously?

1287


two workers can type two pages in two minuets then how many persons can type 18 pages in 6 minuets

1405


Five trays cost is 0.35 each and dozen-----

2177


A triangle has sides of lengths 10, 24 and k. k is a positive integer. The number of values of k for which this triangle has three acute angles is

1554


8 to the power of x is 32,what is the value of x?

1277


In a storage stall of 5x3x2inch.How many blanks of size 2x1x1inch can be stored..

2198


Add a word in starting of SCAPE and at the end of Grass, u will get two different word

1162


Given the length of the 3 sides of a triangle.Find the one that is impossible? (HINT : sum of smaller 2 sides is greater than the other one which is larger)

1238


What is the probability of getting 3 or 4 in 3 consecutive rolls of a dice ?

2379


A student is ranked 13th from right and 8th from left. How many students are there in totality ?

1456


x + 4 y relation between x and y is x/2y = 3/2 ie x = 3y find the x -2y ratio

1119


Find sqrt of 113 up to 3 decimal places.

1186