Arithmetic Operation using one Variable



#include<iostream.h>
#include<conio.h>

void main()
{
    int a, b, c;
    clrscr();

    cout<<"Enter two numbers:";
    cin>>a>>b;

    c = a + b;
    cout<<"Sum is:"<<c;

    c = a - b;
    cout<<"Difference is:"<<c;

    c = a * b;
    cout<<"Product is:"<<c;

    c = a / b;
    cout<<"Division is:"<<c;

    c = a % b;
    cout<<"Remainder is:"<<c;
}
Previous Post Next Post