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 ? | 1 Yes | 3 No |
Post New Answer View All Answers
In simple interest what sum amounts of Rs.1120/- in 4 years and Rs.1200/- in 5 years.
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?
What amount of compound interest can be obtained on an amount of Rs. 4500 at the rate of 4% p.a. at the end of 2 years?
An equilateral triangle of sides 3 inch each is given. How many equilateral triangles of side 1 inch can be formed from it?
Delhi's population is increasing day by day what is the reasong behind it & how can we solve it. G.D QUESTION (amit_nirwan@yahoo.com)
If the data is for 10 bogies and for every 2 bogies added speed decreases by 5% what will be the speed after 5 hrs.
if a man reduces the selling price of a fan from 400 to 380 his loss increases by 20% .cost price of fan is.
SEND + MORE = MONEY. Then what is the value of M + O + N + E + Y ?
3/p=6, 3/q=15 ......find p-q
A moves 3 kms east from his starting point . He then travels 5 kms north. From that point he moves 8 kms east.How far is A from his starting point?
The minimum number of digits required to form every number which is greater than 900 and less than 9,000 is:
A string of alphanumeric is there. Find a string that starts with b and ends with 3 characters.
Find the next series: BC CE EG GK ?
A speedboat whose speed is 15 kmph in still water goes 30 kmph downstream and comes back in a total of 4hrs 30min. What is the speed of the stream in kmph?
How will u divide two numbers in a MACRO?