write a c program to print 1to10 number using goto statement
Answers
Answered by
0
Answer:
Write a c program to print 1 to 10 number using goto statement
Explanation:
#include <stdio.h>
int main()
{
int counter=1;
int n;
//enter the value of n (range)
printf("Enter the value of n: ");
scanf("%d", &n);
//define label
START:
printf("%d ", counter);
counter++; //increment counter
//condition & goto statement
if(counter<=n)
goto START;
return 0;
}
Similar questions