Computer Science, asked by bhoomi18, 1 year ago

using GOTO statement print the following program 1,2,3,4,5,6,7,8,9,10

Answers

Answered by Ashityenjay1
2
#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;
}




hope it may help you. ..

bhoomi18: that was wrong
Ashityenjay1: R u sure
bhoomi18: yes
Ashityenjay1: Wait then let me check it again..
Ashityenjay1: Sorry for inconvenience
bhoomi18: it's ok
Similar questions