This program takes an operator and two operands from the user. Output Enter operator either + or - or * or divide :. If the operator is other than +, -, * or /, error message is shownĬout << "Error! operator is not correct" This program takes an arithmetic operator (+, -, *, /) and two operands from a user and performs the operation on those two operands depending upon the operator entered by the user.Įxample: Simple Calculator using switch statement # include Ĭout << num1 << " + " << num2 << " = " << num1 + num2 Ĭout << num1 << " - " << num2 << " = " << num1 - num2 Ĭout << num1 << " * " << num2 << " = " << num1 * num2 Ĭout << num1 << " / " << num2 << " = " << num1 / num2
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |