Wednesday 8 March 2017

C Program to Print following number pattern

1
12
123
1234
12345


#include <stdio.h>

int main()
{
    int i, j;
    for(i=1;i<=5;i++)
    {
        for(j=1;j<=i;j++)
        {
            printf("%d",j);
        }
        printf("\n");
    }

    return 0;
}



1 comment:

  1. Thanks for sharing this pattern, please give this pattern program in C++. 1 2 4 6 8 10 12..........

    ReplyDelete