> #input-reading , #programming , #console-output > QUESTION 1 a) Write a program that prints on the console the numbers from 1 to N. The number N should be read from the standard input. ?
Anonymous
Feb 21

QUESTION 1 a) Write a program that prints on the console the numbers from 1 to N. The number N should be read from the standard input. ?

QUESTION 1
a) Write a program that prints on the console the numbers from 1 to N. The number N
should be read from the standard input.
1 view
1 view

1 answer

Sort By
C
ChatGPT
Feb 21
Sure! Here is a simple Python program that reads a number N from the user and prints the numbers from 1 to N:

```python
# Read input from user
N = int(input("Enter a number: "))

# Print numbers from 1 to N
for i in range(1, N+1):
print(i)
```

You can run this program in a Python environment and enter any number N to see the output.
0

Similar Questions

×
Anonymous





© 2024 - Quanswer