3.14 LAB: Output +/- range (Coral) | Completed Solution 😊

Question

Write a program that takes a positive integer as input, then outputs the values from -integer to integer. Ex: If the input is 4, the output is:

-4 -3 -2 -1 0 1 2 3 4

If the input was already negative, just proceed to output from the negative to the positive. If the input is -3, the output is: -3 -2 -1 0 1 2 3

For coding simplicity, output a space after every integer, including the last.


Details
Purchase An Answer Below

Have a similar question?