What is the code (in python) to print all the natural numbers ending with 2 between 1 to 99?
Answers
Answered by
0
Hello
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. ...
Using recursive main function: #include <stdio.h> int main() { static int i = 1; if (i <= 100) { printf ( "%d " , i++); main(); } return 0; } chevron_right. Output:
Similar questions
Social Sciences,
6 months ago
Sociology,
6 months ago
Hindi,
6 months ago
Science,
1 year ago
Chemistry,
1 year ago