Programming Shortcut

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

Monday, February 4, 2019

Arithmetic operations in c++ programming

Hello friends! Welcome to my website
How to make a c++ programming for basic arithmetic operations by the simple method?
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 only with their output and your programming is easier.

How to make basic arithmetic operations  in c++ programming


//-----Sart pogramming ------
#include <iostream>
using namespace std;

int main() {
    float a, b, add, sub, multi, div;
 
    //Input Frist Number
    cout << "Please Enter the Frist number: ";
    cin>>a;
    //Outout Second Number
    cout << "Please Enter the Second number: ";
    cin>>b;
    //Basic Airthmatic Operation logics
    add = a + b;
    sub = a - b;
    multi = a*b;
    div = a / b;
 
    //Basic Airthmatic Operations output
cout<<"Airthmatic Operations Result:- "<<endl;
    cout << a << " + " << b << " = " << add << endl;
    cout << a << " - " << b << " = " << sub << endl;
    cout << a << " * " << b << " = " << multi << endl;
    cout << a << " / " << b << " = " << div << endl;
 
    return 0;
}
//----- End Programming ------


output:     Please Enter the Frist number: 5
                Please Enter the Second number: 4
Airthmatic Operations Result:-
5 + 4 = 9
5 - 4 = 1
5 * 4 = 20
5 / 4 = 1.25



Note: The above c++ programming used float type of variable to store these values and result.
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