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;
Write a program that reads data into an array of type int. You must use an array. The numbers input are attendance numbers at a conference. Keep a running average, number of events
Introduction to C++ C++ was developed by Bjarne Stroustrup at Bell Laboratories in 1983. Originally, it was known as " C with class". C+ as an enhancement to the C language was
Write a c++ program to find the sum of 0.123 ? 103 and 0.456 ? 102 and write the result in three significant digits.
compute algorithm to calculate simple interest
1 Aims The main purpose of the assignment is to let you practice the following programming techniques: perform operations on pointers to basic and more complex types;
Define External Storage Class - computer programming? When a variable is declared outside a function the storage is permanently assigned to it and its storage class is 'extern'
The procedure +, * and list take arbitrary numbers of arguments. One way to define such a procedure is to use define with dotted-tail notation. In a procedure definition, a paramet
Problem Description Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new techn
tax
Bubble sort C program: Write a program to define a bubble sort. void main() { clrscr(); int a[100],ch,n; cout cin>>n; for (int i=0;i
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