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 labelSTART:printf("%d ",counter);counter++; //increment counter//condition & goto statementif(counter<=n)goto START;return 0;}
Output
cool hero
0 Comments
Post a Comment