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
please send 10 year question papers of clerical and probationary officer question papers of sbi bank ........syed0460@gmail.com this is my email id....
A man how many bikes of Rs 14000 can buy by selling 2100 bikes of Rs500/- of each
the program requires 4000(n)1/2 [ie square root of n].if size of program was increased by 1% then calculate the percentage change in size of program.
Find the next number in the series 12,21,,112,121,122---
electrical question in diploma level
a person went to a shop and asked for change for 1.15paise. but he said that he could not only give change for one rupee. but also for 50p,25p,10p and 5p. what were the coins he had
Four concentric circles are given. The radius of 1st circle is x. Next is 2x, then 3x and 4x. Given that area between 2nd and 1st is A and 4th and 3rd circles being B. Find ratio of A to B
A man runs towards the east direction and then takes his right. Then he takes a left and again 50 degrees to his right. What is the direction in which he is moving now?
A thief steals half the total no of loaves of bread plus 1/2 loaf from a bakery. A second thief steals half the reaming no of loaves plus 1/2 loaf and so on. After the 5th thief has stolen there are no more loaves left in the bakery. What was the total no of loaves did the bakery have at the beginning.
There are 5 questions based on a murder story.the questions concentrate on the seating arrangements of people mentioned.
Find the Series number: 0,2,3,5,8,10,15,17,24,26,..
Imagine a rectangle.Its length=2*width.A square of 1 inch is cut on all corners so that the remaining portion forms a box when folded.the volume of the box is_____ cubic inches.find the original dimensions of the box.
In how many rows will 200 Miranda bottles be placed, if 200 Miranda bottles are stacked in such a way that there are 20 bottles in the bottom, 19 in the next row, 18 in the row next and so on?
Find the hypotaneous of a right angle isoceles triangle whose area is 50.
The average of 13 papers is 40. The average of the first 7 papers is 42 and of the last seven papers is 35. Find the marks obtained in the 7th paper?