0

How i prepare in geometric calculator in c++ please whom are helping me

Geometric calculator in c++

17th Aug 2019, 11:09 AM
Khaliil Forlan
Khaliil Forlan - avatar
1 Odpowiedź
+ 1
#include <iostream> int main() { std::string method; std::string Options; double num1, num2; std::cout << "Welcome to Calculator.\n"; std::cout << "Can I be of any help?\n"; std::cout << "What do you want to do : "; std::cin >> method; if (method == "addition") { std::cout << "Enter First Value : "; std::cin >> num1; std::cout << "Enter Second Value : "; std::cin >> num2; std::cout << "Answer : "; std::cout << num1+num2; } else if (method == "subtraction") { std::cout << "Enter First Value : "; std::cin >> num1; std::cout << "Enter Second Value : "; std::cin >> num2; std::cout << "Answer : "; std::cout << num1-num2; } else if (method == "multiplication") { std::cout << "Enter First Value : "; std::cin >> num1; std::cout << "Enter Second Value : "; std::cin >> num2; std::cout << "Answer : "; std::cout << num1*num2; } else if (method == "division") { std::cout << "Enter First Value : "; std::cin >> num1; std::cout << "Enter Second Value : "; std::cin >> num2; std::cout << "Answer : "; std::cout << num1/num2; } } mathematic calculator in c++, by using the same method You can create a geometrical calculator.
20th May 2020, 5:11 AM
Ketan Pal
Ketan Pal - avatar