Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
The program reads two numbers and a character (operator). If the character is "+" then sum is displayed. If it is "-"then difference is displayed. If it is "*" then product is displayed. If it is "/" then quotient is displayed. Use a switch statement.
#include
using namespace std; int main ( )
{
int number1, number2, answer1,choice; float answer2;
/* menu of operation*/
cout<<"Menu of Operations"< cout<<"2 Division "< cout<<"3 Addition "< cout<<"4 Subtraction "< /*end of menu*/
cout<<"enter the two integer numbers: "<>number1>>number2;
cout<<"enter your choice: "< cin>>choice;
/* make use of the switch case construct to make decisions*/
switch (choice)
case 1:
answer1= number1 * number2;
cout< case 2: answer2= number1 / number2; cout< case 3: answer1= number1 + number2; cout< case 4: answer1= number1 - number2; cout< default: cout<<"invalid operator"< } return 0; }
case 2:
answer2= number1 / number2;
cout< case 3: answer1= number1 + number2; cout< case 4: answer1= number1 - number2; cout< default: cout<<"invalid operator"< } return 0; }
case 3:
answer1= number1 + number2;
cout< case 4: answer1= number1 - number2; cout< default: cout<<"invalid operator"< } return 0; }
case 4:
answer1= number1 - number2;
cout< default: cout<<"invalid operator"< } return 0; }
default:
cout<<"invalid operator"< } return 0; }
}
return 0;
How to specify different memory sections for a variable using #Pragma?
Use 16 digit credit card numbers that contain 15 digits an 1 check digit. The format of the card number consists of the 15 digits followed by the check digit. The check digit is co
How can one make it so keys pressed through users are not echoed on the screen? A: It is not a standard C++ feature. C++ doesn't even need your system to have a keyboard or a sc
Ques.Implement a c/c++ program to find a shortest path between two nodes in a network?network should be taken as an adjacency matrix.
Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b
Question 1: (a) Explain clearly the following concepts using suitable examples of your own:- (i) concrete class v/s abstract class (ii) constructor v/s over
F u nction Returning Object: This program is like to the previous program except the function returns object. The main rule to be remembered is the function returning obj
palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindromes
Compound Assignment Operators Apart from the binary and the unary arithmetic operators, we also have compound assignment operators. These are +=, -=, *=, /=, %=. Using these op
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd