Count Number of Digits
Program to count number of digits for a given number using goto statement.
Example : pgm.c
#include<stdio.h> int main(){ int t,n,i=1; printf("\nEnter the Limit : "); scanf("%d",&n); printf("\nEnter the Limit : "); scanf("%d",&t); lable: printf("\n%d*%d=%d",i,t,(i*t)); i++; if(i<=n){ goto lable; } }
Output:
Enter the Number : 15
No of Digits : 2
No of Digits : 2