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 Y is 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:-/C51050/SP2022/labs/lab2$ compile prelab2.c jimr@JimRArea51:-/CS1050/SP2022/labs/lab2$ ./a.out Enter 2 integers separated by spaces: 7 11 *** Initial values *** X-7 Y - 11 *** Calculated values *** X times Y - 77 X divided by Y- X plus 1, quantity times Y - 88 *** Final values *** X - 7 Y - 11 Example 2 jimn@JimRArea51:-/CS1050/SP2022/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 *** *** Final values *** X = 15 Y = 7
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