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
Time and speed time and work boat and streams
in a city, there are 100 buildings numbered by corporation between 0-100, how many twos are shown in door,
Each row of letters or numbers has a rule connecting them. Write the next number or letterin the brackets. N , O , M , P , L , Q , K , R , (_ _ _)
If the graphs of the equations x + y = 0 and 5y + 7x = 24 intersect at (m, n), then the value of m +n is?
It takes eight hours for a 600 km journey, if 120 km is done by train and the rest by car. It takes 20 minutes more, if 200 km is done by train and the rest by car. The ratio of the speed of the train?
How many mashes are there in 1 square meter of wire gauge if each mesh is 8mm long and 5mm wide ?
In a two-dimensional array, X (9, 7), with each element occupying 4 bytes of memory, with the address of the first element X (1, 1) is 3000, find the address of X (8, 5).
a man has some hens and cows. If the number of heads be 48 and the number of feet equals 140, then the number of hens will be?
A sales person multiplied a number and get the answer is 3, instead of that number divided by 3. what is th answer he actually has to get ?
Instead of multiplying a number by 7, the number is divided by 7. What is the percentage of error obtained?
4 men can cross a bridge in 3,7,13, 17 minutes. Only two can cross the bridge at a time. The time taken by the two to cross the bridge is equal to the time taken by the slowest person of the two. Find the minimum time to all of them cross the bridge?
how to retrieve the recent record from the database using sql query. suppose the table has the columns only ename,job,salary columns
The ratio for Boys to Girls is 6:4. 60% of the boys and 40% of girls take lunch in the canteen. What % of class takes lunch in canteen.
4^^61 + 4^^62 + 4^^63 + 4^^64 . this sum is divisible by which of the following ?
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