Basic

Switch Case

Goto

Operators

if Statement

Nested if

While Loop

For Loop

Patterns

Array

2D Array

String Function Example

Pointers

Recursion Function

Structure

Excersises

Others


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);
    label:
        printf("\n%d*%d=%d",i,t,(i*t));
    i++;
    if(i<=n){
        goto label;
    }

}

Output:

Enter the Number : 15
No of Digits : 2