PROGRAM TO MAKE A CALCULATOR IN C++



Hello Friends!!! Now I am going to tell about the program to show the function of calculator like add, subtract, divide,multiplication etc. In this program we will make a four simple fuction in a Class..
So Let's Start=>

//Name : Mayank Sharma //
//Roll No : 1101026 //
//CSE(4th Sem)

PROGRAM TO MAKE A CALCULATOR IN C++

#include
#include
class math
{
int a,b,sum,multiply,division,reminder,subtraction;
public:
void add()
{
cout<<"enter the value a,b"<<"\n";
cin>>a>>b;
sum=a+b;
cout<<"The sum is="< }
void mult()
{
multiply=a*b;
cout<<"Multiply is="< }
void div()
{
division=a/b;
cout<<"division is="< }
void rem()
{
reminder=a%b;
cout<<"reminder is="< }
void sub()
{
subtraction=a-b;
cout<<"subtraction is="< }
};
void main()
{
clrscr();
math m1;
m1.add();
m1.mult();
m1.div();
m1.rem();
getch();
}

I think this post will help you.I think this post will help you.
Thanks!!!
If any query about this post then put your comment in comment box below..

0 comments:

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites