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
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.
10 : 4 seconds :: ? : 6 minutes
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.
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?
two workers can type two pages in two minuets then how many persons can type 18 pages in 6 minuets
Five trays cost is 0.35 each and dozen-----
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
8 to the power of x is 32,what is the value of x?
In a storage stall of 5x3x2inch.How many blanks of size 2x1x1inch can be stored..
Add a word in starting of SCAPE and at the end of Grass, u will get two different word
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)
What is the probability of getting 3 or 4 in 3 consecutive rolls of a dice ?
A student is ranked 13th from right and 8th from left. How many students are there in totality ?
x + 4 y relation between x and y is x/2y = 3/2 ie x = 3y find the x -2y ratio
Find sqrt of 113 up to 3 decimal places.