Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Time and speed time and work boat and streams

1513


in a city, there are 100 buildings numbered by corporation between 0-100, how many twos are shown in door,

1188


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 , (_ _ _)

1145


If the graphs of the equations x + y = 0 and 5y + 7x = 24 intersect at (m, n), then the value of m +n is?

1578


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?

1374


How many mashes are there in 1 square meter of wire gauge if each mesh is 8mm long and 5mm wide ?

1296


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).

1488


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?

1325


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 ?

1210


Instead of multiplying a number by 7, the number is divided by 7. What is the percentage of error obtained?

1457


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?

1407


how to retrieve the recent record from the database using sql query. suppose the table has the columns only ename,job,salary columns

2271


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.

1141


4^^61 + 4^^62 + 4^^63 + 4^^64 . this sum is divisible by which of the following ?

1636


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

1571