Program on basic arithmetic operation

Assignment Help C/C++ Programming
Reference no: EM13322808

1. Make a C program that will input two integers and then to enter an option as follows:

1 = to add the two integers.

2 = to subtract the second integer from the first.

3 = to multiply the integers

4 = to divide the first integer by the second integer.

Display an error message if the user enters an option other than 1 through 4 or if the user chooses the divide option by enters 0 for the second integer. Print the results of the arithmetic.T The filename will be Calculate.c

2. Modify the previous program. If the chosen option is 2, the two integers must be compared before the arithmetic operation.

Subtract the two integers provided the first integer is greater than the second integer, otherwise add the two integers and subtract the second integer from the first integer.

Reference no: EM13322808

Questions Cloud

What is the greatest magnitude negative number : What is the largest positive number one can represent in an 8-bits 2's complement code? Write your result in binary and decimal.
What are their resulting velocities : Two 6.0 kg objects head toward each other. Object A moves with a velocity of +7.0 m/s and Object B travels with a velocity of -5.0 m/s. What are their resulting velocities if the collision is perfectly elastic
Analyse the effectiveness of the qantas : Analyse the effectiveness of the Qantas Online Air Ticketing system
What is the speed of sound in helium : It takes sound waves of frequency 500 Hz 14.7 ms to make a round trip through a hollow pipe of length 7.5 m filled with helium. What is the speed of sound in helium
Program on basic arithmetic operation : Two integers must be compared before the arithmetic operation and Subtract the two integers provided the first integer is greater than the second integer, otherwise add the two integers and subtract the second integer from the first integer.
How many turns per unit length should it have : A solenoid is to have an inductance of .272 mH, a cross-sectional area of 6.15x10^-4, and a length of 33.3 cm. How many turns per unit length should it have
Data standards and data security : Data Standards and Data Security
Find the new speed of the rod : A sliding bar has a length of .547m and moves at 2.34m/s in a magnetic field of magnitude .204T. The resistance in the circuit is .698ohms. find the new speed of the rod
Calculate the energy of the incident photons : Electrons are ejected with a maximum velocity of 5.1 x 105 m/s from a metal when illuminated by photons with a wavelength of 440 nm. calculate The energy of the incident photons

Reviews

Write a Review

 

C/C++ Programming Questions & Answers

  Show the contents of the id array

Show the contents of the id array after each union operation when you use the quick find algorithm (Program below) to solve the connectivity problem for the sequence 0-2, 1-4, 2-5, 3-6, 0-4, 6-0, and 1-3.

  Struct complex

A complex number can be represented by two parts, real and image. A series complex data can be organized as a group of elements by linked list, which is shown as below: struct Complex

  After the array is created and loaded

After the array is created and loaded, the problem is then to sort the array and print out the contents of the sorted array. Please use a separate function for the sort routine and also a separate function for the print out of the array.

  Three or more dimensions

What kind of program, or problem, might necessitate arrays of three or more dimensions?

  Coinflip to prompt for and input a number

Write a program and name it CoinFlip to prompt for and input a number of times to flip a coin, then to output the number of "heads" and the number of "tails" that were flipped.

  Written a code that parses through a file reading

written a code that parses through a file reading it line by line and splitting it into tokens by white space. But I want a pair of single quotes to be one token, not how many words are in it

  Write an abstract class carbon footprint

Using an abstract class with only pure virtual functions, create three small classes unrelated by inheritance---clases Building, Car and Bicycle.

  The program will read integers values

Write a C++ program to do the following. The program will read integers values one at a time from standard input (cin) until you read the value 150. assume that the number of values read in is at least 1 and less than or equal to 100

  Create a job class that holds a job id

Create a Job class that holds a Job ID number and the cost of the Job. Include insertion and extraction operators. Create a JobException class that holds a Job and an error message

  Program that incorporates these two functions

Write the program that incorporates these two functions, as described. You will notice that the two functions have very similar statements, so you are doing some repetitive C++ code.

  Determine the meaof the numbers in the array

Determine the mean(average) of the numbers in the array, and output the reslt. Use a subprogram to input the numbers, a function to find the mean.

  Define a class for a type called fraction

Define a class for a type called Fraction. This class is used to represent a ratio of two integers. Include mutator functions that allow the user to set the numerator and the denominator.

Free Assignment Quote

Assured A++ Grade

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!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd