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 / om prakash
#include<iostream.h>
#include<conio.h>
void main()
{clrscr();
int ar[6]={21,23,14,65,2,35};
int min1=ar[0],min2=ar[0];
for(int i=1;i<6;i++)
{
if(min1<ar[i])
{
int min2=min1;
min1=ar[i];
}
}
print(min2);
getch();
| Is This Answer Correct ? | 2 Yes | 3 No |
Post New Answer View All Answers
Refer to the figure below.A ship started from P and moves at a speed of I miles per hour and another ship starts from L and moving with H miles per hour simultaneously.Where do the two ships meet? ||---g---||---h---||---i---||---j---||---k---||---l---|| PG H I J K L are the various stops in between denoted by || . The values g, h, i, j, k, l denote the distance between the ports.
in a question ,last part has, the ages of two people has the ratio of 6:6 and by adding the numbers we get 44, after how many years the ratio would be 8:7?
Find the next series: BC CE EG GK ?
Find the value of @@+25-++@1..., where @ denotes "square" and + denotes "square root".
in space ship 5men are going1.doctor,drug asdditive 2.lady lawer has done crime 3.teacher emotinally imbalanced 4. 18 year old aeruonautical engineer 5. noble lauraut .suddenly some thing happend and oxygen is available to only three people to use which of three you choose
There are 5 red shoes, 4 green shoes. If one drasw randomly a shoe what is the probability of getting redshoe is
HERE = COMES – SHE, (Assume s = 8), Find value of R + H + O
Pipe A can fill a tank in 30 mins and Pipe B can fill it in 28 mins.If 3/4th of the tank is filled by Pipe B alone and both are opened, how much time is required by both the pipes to fill the tank completely ?
Pankaj walks east and turns right and then from there to his left and then 45degrees to his right. In which direction did Pankaj go?
The difference between two numbers is 1365. When you divide the larger number with the smaller number the quotient is 6 and remainder is 15. What is the smaller number?
Daal is now being sold at Rs. 20 a kg. During last month its rate was Rs. 16 per kg. By how much percent should a family reduce its consumption so as to keep the expenditure fixed?
Perimeter of the back whell = 9 feet, front wheel = 7 feet on a certain distance the front wheel gets 10 revolutions more than back wheel . what is the distance?
There are following denominations of money: 1, 2, 5, 10, 20, 50, and 100 paise. Alex has as twice mony as David, who has as twice as Bindya, who again has as twice money as Charles. Each has two coins in hand. Which coins Bindya has?
Find the speed of the boat in still water if the river runs at 4 km/hr. The time taken by a Suresh to row the boat upstream is 3 as the time taken by him to row it downstream.
What Is Kyc?