Sunday, August 19, 2018

Positive and Negative Number Checker Using Nested If in C++

Here is a sample code that I wrote using C++ to show how nested if statement work I called this program Positive and Negative Number Checker Using Nested If in C++.

I am currently accepting programming work, it project, school 

programming projects , thesis and capstone projects, IT consulting 

work, computer tutorials and web development work kindly contact me in the following email address for further details.  If you want to advertise in my website kindly contact me also in my email address also. Thank you.
My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

My personal website is http://www.jakerpomperada.com






Sample Program Output


Program Listing

// nested.cpp
// Author    : Mr. Jake R. Pomperada,BSCS,MAED-IT
// Date      : August 18, 2018  Saturday
// Location  : Bacolod City, Negros Occidental
// Website   : http://www.jakerpomperada.com
// Email     : jakerpomperada@jakerpomperada.com

#include <iostream>

using namespace std;

int main() 
{
    int number=0;
    
    cout << "\n\n";
cout << "\tPositive and Negative Number Checker";
cout << "\n\n";
    cout << "\tEnter an integer: ";
    cin >> number;

    if ( number > 0)
    {
        cout << "\n\n";
cout << "\tYou entered " << number << " a positive integer.";
    }
    else if (number < 0)
    {
        cout << "\n\n";
cout<<"\tYou entered " << number <<  " a negative integer.";
    }
    else
    {
        cout << "\n\n";
cout << "\tYou entered 0.";
    }
    cout << "\n\n";
cout << "\tEnd of Program";
cout << "\n\n";
return 0;
}




No comments:

Post a Comment