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++.

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
Get step-by-step solutions from verified subject matter experts
