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


Please Help Members By Posting Answers For Below Questions

A worker pay Rs20 a day ,he works 1,1/3,2/3,1/8,3/4 in a week.What is the total amount paid to the worker.

810


Please provide me rs aggarwal verbal reasoning book link pleeeeeeeez

1024


Hi friends i am new to this site. Pls provide me the KVB clerical exam model question papers. pls send to mail id mailstoaaa@gmail.com. Hope u guys will help me.

1742


Petrol prices increased by 40% expected hike in taxi & auto charges so, people may use public transport systems. What do you infer?

705


In a certain college, 20% of the boys and 40% of the girls attended the annual college outing. If 35% of all the students are boys, what percent of all the employees went to the outing?

949






A sales person multiplied by a number and get the answer 3. Instead of that number divided by 3. What is the answer she actually has to get. (1/3) * 1 *3 =3 so the no= 1 divided by three.

702


One man brought pen and book from 250 and he sold both at 10% profit on pen and 20% loss on book and finally he gained 40% what is the value of pen

770


There are no of urns &no of balls. If three balls are placed in each urn then 3 balls is left. If 4 balls are placed in each urn then 1 urn is left. What is the total no of balls?

683


two persons run a race of 100m. the winner won by (110/11)m and one second in time. find the speed of lsoer in met

726


if a man byes 1 lt of milk for 12 rs and mixes with 20% of water and sels it for rs 15 thgen what is percentage of gain

769


Package information is stored in a) DB2 Directory b) DB2 system tables c) DB2 catalog tables d) None of the above

1657


what can you contribute to the fiscal commission?

1554


I want Canara Bank Question papers ? if u have this one send my mail. id - kuruba.sreekanth@gmail.com -regards

1659


if 8x+4y=6 and 4x+5y=7, x+y equlals

714


what is the exact qualifing marks for group 1 prelims

1838