Programming Shortcut

Write, Run and execute Your programs with simple and esay way by Programming Shortcut

Monday, February 4, 2019

Bigger and smaller number in c++

Hello friends! Welcome to my website
C++ programming to find the bigger and smaller number between two numbers?
This c++ language programming is free all type of errors like compiler and runtime errors and this programming is tested to compile and then run the program code.
Here is only programming code with their output. This programming output is customized to understand easily.

Program to print the bigger and smaller number between two numbers in c++ language


#include <iostream>
#include <cmath>
using namespace std;

class Test {
public:
    int a, b;

    void bigger(int a, int b) {
        if (a > b) {
            cout << a << " is bigger then " << b << endl;
        }
        else {
            cout << b << " is bigger than  " << a << endl;
        }
    }

    void smaller(int a, int b) {
        if (a < b) {
            cout << a << " is smaller then " << b << endl;
        }
        else {
            cout << b << " is smaller than  " << a << endl;
        }
    }
};

int main() {

    Test o;
    cout << "Enter the frist number: ";
    cin >> o.a;
    cout << "Enter the second Number: ";
    cin >> o.b;
    cout << "Result is following:" << endl;
    o.bigger(o.a, o.b);
    o.smaller(o.a, o.b);
    return 0;
}


output:
Enter the frist number: 4
Enter the second Number: 8
Result is following:
8 is bigger than  4
4 is smaller then 8


I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any dought about this c++ programming code or input & output please comment below
If you have other question about c++ programming send an email by contacting us form are given on page right side.
Thank You!

About Programming Shortcut

This is a programming learning website that can help you learn and when your write your programming code. And all programming code is compiled run programming code in the following programming language C, c++, Java, php and Javascript Languages. find your programming read, understand the programming then copy and past and run your program and save your golden time to typing the program becuse you learn more in leas time. All Programming is codeing is ease to understand the programming