Number Pattern Program in C - 60


c program for pattern


N=39714

/*
Write a program in C for Number Pattern Program
*/

#include <stdio.h>

int main()
{
    long n = 39714, i=1;
    for(i=10;i<n;i*=10);

    for (i=i/10; n>0; i/=10)
    {
        printf("%d\n", n);
        n%=i;
    }

    return 0;
}

Post a Comment

0 Comments