Cpp Basic 61: Math float

11 January 2020, 1:48 am by antelove19

Cpp programming language

Cpp programming language



Happy Coding


main.cpp

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

#include <iostream>

using namespace std;

int main() {

    float a;
    float b = 2;

    cout << "Input an float ( > 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