Search This Blog

Loading...

Calculator in C++

simple calculator with Addition,Subtraction,Multiplication and Division operations.

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

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

    cout<<"Enter the value of a : ";
    cin>>a;

    cout<<"Enter the value of b : ";
    cin>>b;

    c=a+b;
    cout<<"Addition = "<<c<<endl;

    c=a-b;
    cout<<"Subtracion = "<<c<<endl;

    c=a*b;
    cout<<"Multiplication = "<<c<<endl;

    c=a/b;
    cout<<"Division = "<<c<<endl;

    getch();
}

No comments:

Post a Comment