Ticker

6/recent/ticker-posts

Header Ads Widget

Program to Create Simple Calculator

PROGRAM  TO CREATE BASIC CALCULATOR || BigFootCODE

Introduction

We are going to make a small program that can implement the basic calculation using the four basic operands like addition, subtraction, multiplication and division. Our program would be a standardized that can take user input from the user and will compute the code for our user accordingly and give result of it. Our messages can be made up so that the person makes out decision for operation on two numbers and writes code for it. Here we show a message or produce an output for the result.

program , coding , cpp , program creating basic calculator , bigfootcode , mohitblog , mohit ka blog, mohit kumar , mohitkumar
Basic mathematics operators




These messages can be made up to where someone who has never programmed before will be able to complete this work and would be able to use it easily without and need of programmer.this program creating basic calculation is very simple. You just have to write the code logic from here and you can implement this in any programming language. Like java, c , cpp, python.


Q) Write a program to implement the four basic operation of subtraction ,addition , multiplication  and division.

sol)

code:-

#include<iostream.h> #include<stdlib.h> int main() { system("cls") char ch; float a,b,result; cout<<"enter two numbers:"; cin>>a>>b; cout<<"\n"<<"enter the operator(+,-,*,\):"; cin>>ch; cout<<"\n"; if(ch=='+') result= a+b ; else if(ch=='-') result= a-b ; else if(ch=='*') result= a*b ; else if(ch=='/') result= a/b ; else {cout<<"\n"<<"wrong operators !"<<'\n"; goto lb ; } cout<<"\n"<<"the calculated result is :"<<"\n"<<result<<"\n"; lb: return 0; }




Note:- if any question or problem let us know put it in the comment below. join us for more !!





Post a Comment

0 Comments