C++ Program to find second minimum number
Programs:
#include<iostream>
using namespace std;
int main()
{
int num, min, sec_min;
for(int n=1; n<=10; n++)
{
cout<<"Please Enter a Number= ";
cin>>num;
if(num<=min)
{
sec_min=min;
min=num;
}
}
cout<<"Minimum Number= "<<min<<endl;
cout<<"Second Minimum Number= "<<sec_min;
return 0;
}
Comments
Post a Comment