Loop and Input a) Request two numbers, n1 and n2 from the console. b) n1 and n2 can be any integer value. c) Use a while loop to horizontally print n1 to n2 with increment by 1 if n1 is smaller than n2. d) Use a for loop to horizontally print n1 to n2 with decrement by 1 if n1 is greater than n2. e) Print a message, “n1 = n2” if n1 is equal to n2.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.2: While Loops
Problem 8E: (Numerical analysis) a. The following is an approximate conversion formula for converting Fahrenheit...
icon
Related questions
Question

 Loop and Input
a) Request two numbers, n1 and n2 from the console.
b) n1 and n2 can be any integer value.
c) Use a while loop to horizontally print n1 to n2 with increment by 1 if n1 is smaller than n2.
d) Use a for loop to horizontally print n1 to n2 with decrement by 1 if n1 is greater than n2.
e) Print a message, “n1 = n2” if n1 is equal to n2.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Concept of memory addresses in pointers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr