Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Concepts to Practice Simple input/output Integer variables Arithmetic operators Description For the prelab assignment, write a C program that reads in two integer numbers from
Concepts to Practice Simple input/output Integer variables Arithmetic operators Description For the prelab assignment, write a C program that reads in two integer numbers from user input. Save the values of these numbers in two variables called X and Y. Print the values of X and Y. Print the value of X multiplied times Y. Print the value of X divided by Y. Print the value of X plus 1, quantity times Y (e.g., if X is 5 and Yis 2 then X plus 1 quantity times Y is 12 because X plus 1 is 6 and 6 times 2 is 12). Print the values of X and Y again to show that they did not change. Example 1: JimR@JimRArea51:-/CS1050/FS2019/Labs/Lab2$ compile prelab2.c JimR@JimRArea51:-/CS1050/FS2019/Labs/Lab2$ /a.out Enter 2 integers separated by spaces: 15 7 *** Initial values *** X = 15 Y = 7 *** Calculated values *** X times Y = 105 X divided by Y = 2 X plus 1, quantity times Y - 112 *** Final values ** X = 15 Y = 7 Example 2 JimR@JimRArea51:-/C51050/FS2019/Labs/Lab2$ compile prelab2.c JimR@J imRArea51:-/CS1050/FS2019/Labs/Lab2$ ./a.out Enter 2 integers separated by spaces: 1 2 *** Initial values *** X = 1 Y = 2 *** Calculated values *** X times Y = 2 x divided by Y = X plus 1, quantity times Y = 4 *** Final values *** X = 1 Y - 2
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started