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

  Design a class box that defines a box on a floor

Design a class box that defines a box on a floor. A box has a number and an (a,b) location where a and b are numbers between -5, and 5.

  Supposed to swap numbers

The program is supposed to swap numbers, but I am stuck something is wrong! It does not swap them it repeats the second number, please help to fix! Thanks, this is in C++.

  Problems on oops

Problems on OOPS

  A used car dealership maintains an inventory

Submit the completed program (all 4 parts) including all class definitions/implementations in a single .cpp source file (i.e., do not construct separate files for class headers and implementation).

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Write a complete c++ program

The main program will read in a parameter value n (read this in main). Then it will call a function read2arrays (details below) to read lists of grades into two arrays, which the main program will call test1 and test2 (or some other names of your ..

  Declare a 1-dimensional array of integers

In pseudocode and in C code, declare a 1-dimensional array of Integers called InternetHits that will hold up to 10 Integer values representing the number of hits a Web site receives.

  Design for storing the maze layout

Design and implement a C++ program for maze layout

  Throws an exception from a deeply nested

Write a program that throws an exception from a deeply nested function and still has the catch handler following the try block enclosing the initial call in main catch the exception

  Structs in an array of employee data.

Below is the instructions of my C++ Lab. The program must build in Microsoft Visual C++. Please use headers so the program will compile

  A pattern detector has an input

A pattern detector has an input a 4 x 4 matrix whose elements take values a, b, c, or d. The output is 1 if the matrix contains one b surrounded by eight a's and 0 otherwise.

  We have to deal with student pilots

We have to deal with student pilots and airplanes. Students have a unique student id, a name, and a year that students are in. Airplanes have a unique airplane id, model, a cruising range

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