Horje
C++ Arithmetic Operators Code Example
C++ Arithmetic Operators
    int a, b, sum, difference, product, quotient, remainder;
    //Using all arithmetic operators, choose what you're looking for

    cout << "ADDITION" << endl;
    cout << "\n";
    cout << "Enter number: " << endl;
    cin >> a;
    cout << "Enter the second number: " << endl;
    cin >> b;
    sum = a + b;
    cout << "The sum is: " << sum << endl;
    cout << "\n";

    cout << "SUBTRACTION" << endl;
    cout << "\n";
    cout << "Enter number: " << endl;
    cin >> a;
    cout << "Enter the second number: " << endl;
    cin >> b;
    difference = a - b;
    cout << "The difference is: " << difference << endl;
    cout << "\n";

    cout << "MULTIPLICATION" << endl;
    cout << "\n";
    cout << "Enter number: " << endl;
    cin >> a;
    cout << "Enter the second number: " << endl;
    cin >> b;
    product = a * b;
    cout << "The product is: " << product << endl;
    cout << "\n";

    cout << "DIVISION" << endl;
    cout << "\n";
    cout << "Enter number: " << endl;
    cin >> a;
    cout << "Enter the second number: " << endl;
    cin >> b;
    quotient = a / b;
    cout << "The quotient is: " << quotient << endl;

    remainder = a % b;
    cout << "The remainder is: "<< remainder << endl;




Cpp

Related
retourner pointeur de type qstringlist qt Code Example retourner pointeur de type qstringlist qt Code Example
how to set a string equal to another string cpp Code Example how to set a string equal to another string cpp Code Example
uri online judge 3145 solution in c++ Code Example uri online judge 3145 solution in c++ Code Example
ue4 bind function to button clicked c++ Code Example ue4 bind function to button clicked c++ Code Example
C++ Area of Triangle Code Example C++ Area of Triangle Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11