WRITE THE PYTHON PROGRAM
USING THE LOOP TO PRINT NUMBERS FROM 1 TO 10
Answers
Answered by
14
Answer:
Open your Start menu and choose Python (command line). You should get a prompt that looks like >>>. ...
At the prompt, type the following. Use a single quote at the start and the end — it's beside the Enter key: ...
Press the Enter key. Python runs the code you typed.
Explanation:
Using goto statement: #include <stdio.h> int main() { int i = 0; begin: i = i + 1; printf ( "%d " , i); if (i < 100) goto begin; return 0; } chevron_right. Output: ...
Using recursive main function: C. filter_none. #include <stdio.h> int main() { static int i = 1; if (i <= 100) { printf ( "%d " , i++); main(); } return 0; }
Answered by
2
Explanation:
Python program to print numbers from 1 to 10.
i= int
for i in range (1,11):
print(i)
Similar questions