Cpp Basic 60: Math

11 January 2020, 1:11 am by antelove19

C++ programming language

C++ programming language



Happy Coding


main.cpp

/* ------------------------------------------------------------ */
/*  Math                                                        */
/*  Using Arithmetic Operators (integer)                        */
/*                                                              */
/*  Author: antelove                                            */
/*  Website: antelove.com                                       */
/* ------------------------------------------------------------ */

#include <iostream> // standar input output library

using namespace std;

int main() {

    int a;
    int b = 2;

    cout << "Input an integer ( > 2 ): " << endl;
    cin >> a;

    cout << a << " + " << b << " = " << a + b << endl;
    cout << a << " - " << b << " = " << a - b << endl;
    cout << a << " * " << b << " = " << a * b << endl;
    cout << a << " / " << b << " = " << a / b << endl;
    cout << a << " mod " << b << " = " << a % b << endl;

    return 0;

}

Thank for reading :)


Keywords:


No Action Title
1 Live
2 Editor
0 comment