How to Split 5 digit no in Basic units in Turbo C

  • How to Split 5 digit no in Basic units in Turbo C

  • 1 Comment sorted by


  • #include
    #include
    void main(void)
    {
    long a,b,c,d,e;
    clrscr();
    printf("enter any five digdit number:");
    scanf("%ld",&a);
    if(a<=10000||a>=99999)
    {
    printf("\n incorrect statment");
    }
    else
    {
    b=a%10;
    a=a/10;
    printf("\n once is%ld",b);
    c=a%10;
    a=a/10;
    printf("\n tens is %ld",c);
    d=a%10;
    a=a/10;
    printf("\n thndred is %ld",d);
    e=a%10;
    a=a/10;
    printf("\n thousand is %ld",e);
    printf("\n ten thousand is %ld",a);
    }
    getche();
    }


Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Popular Posts of the Week

Top Posters Weekly

Optimum Creative