By Rishita
A calculator built using C++ which can perform basic arithmetic operations like addition, subtraction, multiplication, division, etc.
I have made a basic scientific calculator which can perform various arithmetic operations like addition, subtraction, multiplication, division, power, factorial, square, cube and square root.
In the code in the main section, I have made a switch statement that takes an integer choice and that integer decides which operation to be performed. That means when we:
Enter 1 it means addition.
Enter 2 it means subtraction.
Enter 3 it means multiplication.
Enter 4 it means division.
Enter 5 it means power.
Enter 6 it means Factorial.
Enter 7 it means square.
Enter 8 it means cube.
Enter 9 it means square root.
After entering the choice in the switch statement it goes to the function given in that case and performs the required operation accordingly. Thus this is a simple calculator which is easy and understandable. The entire code is in only C++ language.
Submitted by Rishita (Riya12)
Download packets of source code on Coders Packet
Comments