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

  Write a program to find the middle element in a linked list

1. Write a program to check if there is a loop in a linked list. Create a loop in a linked list and use your method 'isLoop' to identify that the loop exists. The method isLoop should return a Boolean type.2.

  Performs a binary search instead of a linear search.

Modify the following program so it performs a binary search instead of a linear search. Use the selection sort algorithm to sort the array before the binary search is performed.

  Up through 2 to the 10th power

program should compute and output all of the "powers of two" from 2 to the 0th power, up through 2 to the 10th power.

  Summarizing your predicted and actual output

Write a statement summarizing your predicted and actual output, and identify and explain any differences. For your conclusions, write at least one nontrivial paragraph that explains, in detail, either a significant problem you had and how you solv..

  Write a small program to simulate a raffle

Write a small program to simulate a raffle (a gambling game) for a group with 100 members. You can simply identify each member with a no-duplicated ID numbers from 01 to 100. A number ticket with a positive 4-digits integer number will be randomly cr..

  Iimplement a client-server of the game

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

  Write a program to calculate existing angles

Write a program to calculate existing angles and do if and then from this, and to place fixed angles at certain position.

  Output the even numbers from 1 to 10 in ascending order

Output the even numbers from 1 to 10 in ascending order, then the odd numbers from 10 to 1 in descending order: 2 4 6 8 10 9 7 5 3 1. in C++

  Create a c++ console application

Objective: Create a C++ console application that will model the characteristics of a resistor. Create a multifile project. Create and add to the project an h file containing the resistor-class definition. Create and add to the project a cpp file cont..

  Function that accepts a pointer to a c-string

Write a function that accepts a pointer to a C-string as an argument and returns the number of words contained in the string. Also have it display the average number of letters in each word.

  The actual solution of the equation shall be done

The actual solution of the equation shall be done by a function named equSolver(), which takes three coefficients as parameters and returns a structure of three fields: two roots (if they exist) and a boolean indicator, whether the roots do exist.

  Program to calculate word ladders where single-character

Write down a program in C++ to calculate word ladders where single-character substitutions have the cost of 1, and single-character additions or deletions.

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