Sunday , January 20 2019
Home / Tech / How to Create Simple Calculator in C++ Program
How to Make Simple Calculator in C++ Program

How to Create Simple Calculator in C++ Program

How to Create Simple Calculator in C++ Program (TurboC++): Hello, Everyone today i am going to share with You guys that how to Create Simple Calculator in C++ Program (TurboC++). This Program will takes an Arithmetic Operator Such as (+,-,/,*).1

How to Create Simple Calculator in C++ Program

1

2

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float a,b;
char op;
cout<<endl<<“Enter the first value=”;cin>>a;
cout<<endl<<“Enter the Second value=”;cin>>b;
cout<<endl<<“Enter the Operator (+,-,/,*)=”;cin>>op;
if (op==’-‘)
cout<<endl<<“Subtraction Answer=”<<a-b;
else
if (op==’+’)
cout<<endl<<“Addition Answer=”<<a+b;
else
if (op==’*’)
cout<<endl<<“Multiplication Answer=”<<a*b;
else
if (op==’/’)
cout<<endl<<“Division Answer=”<<a/b;
else
cout<<endl<<“You entered Invalid operator”;
getch();
}

Addition Answer

Addition

Subtraction Answer

Subtraction

Multiplication Answer

Multiplication

Division Answer

Division

Read Also: How to install Turbo C++: Compile and Run a C++ Program

About Mirza Ghalib

A Passionate Bloggers from Pakistan, Who Loves to Put Content That Talks About The Reality of Current Situations.

Check Also

Google Chrome - How to Disable A Keyboard Shortcut

Google Chrome – How to Disable A Keyboard Shortcut

Google Chrome is an Open Source Browser. Like Other Browser, Google Chrome has Keyboard Shortcuts …

Leave a Reply

Your email address will not be published. Required fields are marked *