Program for smallest number among two numbers in C++

 #include<iostream>

using namespace std;

int main()

{

int num1,num2;

cout<<"Enter first number ";

cin>>num1;

cout<<"Enter second  number ";

cin>>num2;

  cout<<"\t Program to find smallest number among two numbers\n";

  if(num1<num2)

  {

   cout<<"1st number is smallest";

  }

  else

   cout<<"2nd number is smallest";

}


Output:

Enter first number 12

Enter second  number 22

         Program to find smallest number among two numbers

1st number is smallest


Comments