Develop a C program to print 1 to 10 numbers using goto statement. (Hint: use increment operator)

Code

#include <stdio.h>

int main()
{
int counter=1;
int n=10;
//define label
START:
printf("%d ",counter);
counter++; //increment counter
//condition & goto statement
if(counter<=n)
goto START;
return 0;
}

Output


cool hero