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 C program to input three real numbers and print them out as follows : The first variable is ....... and the second one is ...... The last variable is .......... T
Explain each of the algorithms in a way that would be understandable to an intelligent person who is not familiar with programming. You should not use any code (or even pseudo code
Question 1 Explain the concept of constructors and destructors in C++ with programming examples Question 2 Explain the concepts and applications of multiple inheritance and v
Introduction: This assignment requires a knowledge of variables (integers, char types), loops, conditionals, switch, functions, char arrays, string arrays, number arrays, struc
Program to draw a circle: int main(void) { /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int midx, midy; int radius = 100;
Create an applet that bounces a blue ball inside an applet using Thread. The ball (diameter is 10) will start at position (0,0). When the ball hits the edge of the applet, the ba
defining software crisis As the technology changes rapidly the requirement for the users' change, to part the growing demand of the user for trade, business, and personal
List any six commonly found programming errors in a C program Six commonly found errors in a C program are: 1. Missing or misplaced ; or }, missing return type for a proc
program
Define the C Preprocessor? Preprocessor' is a translation stage that is applied to your source code before the compiler proper gets its hands on it usually the preprocessor per
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