Is the number greater or less than 100 – C++ Program

What it does:
A simple program which finds if the number enter is greater or smaller than 100 using if else.

Code:

 

#include <iostream>
using namespace std;
int main()
{
    int i;
    cout << “Type any number: “;
    cin >> i;
    if (i > 100)
    {
        cout << “It’s greater than 100.” << endl;
    }//if
    else if (i > 10)
    {
        cout << “It’s greater than 10” << endl;
    }//else if 
    else
    {
        cout <<
          “It’s neither greater than 100 nor greater than 10.”
          << endl;
    }//else
    return 0;
}//main

2 thoughts on “Is the number greater or less than 100 – C++ Program

  1. Your style is so unique in comparison to other folks I have read stuff from.
    Many thanks for posting when you’ve got the opportunity, Guess I will just bookmark this web site.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s