Searching...

If-else Example

15:53

#include <iostream>
using namespace std;
int main ()
{
    int a = 100;
    if( a < 20 )
   {
       // if condition is true then print the following
       cout << "a is less than 20;" << endl;
   }
   else
   {
       // if condition is false then print the following
       cout << "a is not less than 20;" << endl;
   }
   cout << "value of a is : " << a << endl;

   return 0;
}

0 comments:

Post a Comment

Thanks For Your FeedBack....