27 December, 2012

C++ Program To Find Lowest Number Out Of Three Numbers.

This Post Contains A C++ Program To Find Lowest Number Out Of Three Numbers With Correct Source Code & Output. This Program Is Written, Compiled & Executed At TurboC3.0 Compiler & Will Help You To Understand The Concept Of 'If...else' From C++ Language. It Is A Well-Structured Program With Proper Comments Which Provides Step-By-Step Description Of Various Features Of The Language In A Simple & Easy-To-Understand Way.


 # Note : You Can Simply Copy-Paste The Following Program Or Code Into Compiler For Direct Result.


C++ Program To Find Lowest Number Out Of Three Numbers.

/* Declaration Of Header Files */
# include <iostream.h>
# include <conio.h>

/* Start Of Main Program */
void main( )
{
     
      /* Declaration Of Variables */
      int  a,  b,  c;
      clrscr();

      /* Asking For The Input From User */
      cout << " Enter Any 3 Value : ";
      cin >>  a  >>  b  >>  c;

      /* Source Code For Computing Lowest Number Out Of Three Numbers */
      if ( a < b && a < c )
      {
             cout  <<  a  <<  " Is The Lowest Number.  ";
      }
      else
      {
             if ( b  <  c )
             {
                      cout  <<  b  <<  " Is The Lowest Number.  ";
             }
             else
             {
                     cout  <<  c  <<  " Is The Lowest Number.  ";    
              }
       }
       getch();
}
/* End Of Main Program */

Output :

Enter Any 3 Values :   12   24   36

12 Is The Lowest Number.  



No comments:

Post a Comment

Subscribe To:

Most Commonly Asked Programs In 'C' & 'C++' Language.