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;
C tokens assignment
The #define Directive The #define directive explains a macro which is a text string represented by a name. Whenever the pre-processor finds this name in the program, it is repl
Define the Data Type Qualifiers in c Language? 1. const 2. volatile const: The const qualifier is used to tell C that the variable value can't change after initialization.
A 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 palindrome
#Hi, I''m planning to derive the escape velocity through C++. I would just like to know if it''s possible to differentiate symbolic functions? Do I need to download libraries,etc?
write a class player that contains attributes for player name,avg and team.write three functions to input,change and display these attributes.also write a constructor that asks for
#question.conversion of tree into binary tree.
How to Create A Data File? A data file should be created before it can be processed. A stream-oriented data file is able to be created in two ways. One is to create the file st
You are required to write a stand-alone DSP application in the C programming language. The overall objective of this application is to convert a signal from the time domain to t
A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string of t
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: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd