C Program to print 1 to 10 numbers without using a loop


In this program, You will learn how to print 1 to 10 numbers without using a loop in c.


start:

goto start;

Example: How to print 1 to 10 numbers without using loop in c.

#include<stdio.h>

int main() {

   int i = 0;

   start:
   i++;
   if (i <= 10) {
       printf("%d\n", i);
       goto start;
   }
   printf("Exit From goto");

   return 0;
}

Output:

1
2
3
4
5
6
7
8
9
10
Exit From goto