Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You don't need to do the honors portion!! Concepts to Practice Simple input/output Integer variables Arithmetic operators Extend Prelab 2 Submission Information Submit this assignment

image text in transcribedimage text in transcribedYou don't need to do the honors portion!!

Concepts to Practice Simple input/output Integer variables Arithmetic operators Extend Prelab 2 Submission Information Submit this assignment by following the instructions given by your TA. SUBMIT ONLY the .c file (no a.out or executable file is required). All of the lab assignments must be submitted before the end of the lab using the lab code given by the TA. Use the following submit command: mues submit For example: mues submit 1050 lab2 lab2.c Description For the lab assignment, write a C program that reads in four integer numbers from user input that will be entered on the same line and separated by a space. The first integer should be called A, the second B, the third C, and the fourth D. Print the following: Print the values of A, B, C, and D. Print the value of the sum of B and C. Print the value of the product of A and D. Print the value of the integer quotient of A divided by C. Print the value of the integer remainder of divided by D. Print the value of the quantity A times divided by (integer division) the quantity B plus D. Honors Extension No need to do this part if you are not in the honors section. If you are in the honors section of the course, please also print the following: Print the exact quotient of each of the 4 values (A, B, C, and D) divided by 2. You may only use e integer variables. We have not talked about "cast" and you don't need to use it (but if you do, 1 won't hold it against you, it is just cooler if you don't). Hint 1: If something is divisible by 2, there is nothing after the integer quotient. If something is not divisible by 2, there are always 2 specific characters printed after the integer quotient. Hint 2: If you don't print a newline (" ") with printf(), the next thing you print will be on the same line where you left off. Sample Output 1 Enter 4 integers (A,B,C,D) separated by spaces: 4 3 5 7 *** Initial values *** A-4 B-3 C-5 D-7 *** Calculated values *** The sum of B and C-8 The product of A and D. 28 The integer quotient of A divided by C. The integer remainder of C divided by D - 5 The product of A and C divided by the quantity sum of B and D. 2 *Honors: A/2-2 B/2-1.5 C/2-2.5 D/2-3 Sample Output 2 Enter 4 integers (A,B,C,D) separated by spaces: 7 19 4 52 *** Initial values *** A-7 B-19 C-4 D-52 *** Calculated values *** The sum of B and C - 23 The product of A and D - 364 The integer quotient of A divided by C. 1 The integer remainder of C divided by D - 4 The product of A and C divided by the quantity sum of B and D. *Honors: A/2-3.5 B/2-9.5 C/2-2 D/2-26.5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions