Question: This program is in C, not C++. Write a program that prints all the numbers that are between 1 and a certain integer, either in

This program is in C, not C++.

This program is in C, not C++. Write a program that prints

Write a program that prints all the numbers that are between 1 and a certain integer, either in ascending order or in descending order. The first input is a positive integer. The program will list the numbers between 1 and that positive integer. The second input should be (1) to count up or (0) to count down. What are the invalid cases for each input? If any input is invalid, the program should print an error message and terminate without printing any numbers. The format of the numbers list should be with 'comas' and a 'space' separating the numbers and with a 'dot' after the last number, as shown below. Enter a positive integer: 10 Enter up (1) or down (0): 0 Counting down: 10, 9, 8, 7, 6, 5, 4, 3, 2, 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!