Published: 02 Apr 2018 › Updated: 02 Apr 2018
Very basic Calculator program in C++
Program
A program is set of instruction given by user to computer to perform a specific task.computer program, in depth intend or else process in lieu of solving a riddle by means of a computer; supplementary specifically, an unambiguous, well thought-out string of computational advice indispensable near attain such a solution.
Program Body:
#include< math.h>am >
#include< math.h >
using namespace std;
class calculator{
private:
double first,scnd,result;
char op;
public:
void cal(){
cout<<"Enter your first value "<<endl;
cin>>first;
cout<<"put any basic operator "<<endl;
cin>>op;
cout<<"Enter your second value"<<endl;
cin>>scnd;
if(op=='+'){
result=first+scnd;
cout<<"your result is "<<result<<endl;
}
else if(op=='-')
{
result=first-scnd;
cout<<"your result is "<<result<<endl;
}
else if(op=='*')
{
result=first*scnd;
cout<<"Your result is "<<result<<endl;
}
else if(op=='/')
{
result=first/scnd;
cout<<"your result is "<<result<<endl;
}
}
};
int main(){
calculator object;
object.cal();
}
Written in C++
Made in Visual C++ IDE
I hope it was helpful and you learned something from it, Thanks
Leave Very basic Calculator program in C++ to:
Read more #programming posts
Best Posts From Innoxent Doll
We have not curated any of hairflare's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Innoxent Doll
- Guide To The Project Management Processes
- MARS InSight - MARS InSight Mission Skip Navigation
- C++Builder - Design Build and Run your application
- Carlson SurvPC - Carlson SurvPC is the flexible data collection application
- Logopress3 - Logopress3 2016 for SolidWorks is an impressive die designs
- Switzerland Is The Place For Tourism ,Vacation, Holiday, Travel.
- Updated game new features: two structures; 1. immobile and other mobile 2. Change of color when collide
- Small game making in C++
- Very basic Calculator program in C++
- Program for checking Vowel and Consonants. In C++