Follow on Facebook

Like and Share on Facebook

Showing posts with label How to Print Pattern 1 23 345 6789 1011121314 in C. Show all posts
Showing posts with label How to Print Pattern 1 23 345 6789 1011121314 in C. Show all posts

Monday, February 16, 2015

How to Print Pattern 1 23 456 78910 1112131415 in C


#include <stdio.h>
#include <conio.h>

void int rows, a,  b, number = 1;
printf("Number of rows of Floyd's triangle to print:");

scanf("%d",&rows);
for ( a = 1 ; a <= rows ; a++ ) {
for ( b = 1 ; b <= a ; b++ ) {
printf("%d ", number);
number++;
}
printf("\n");
}
}

Output:

1
23
456
78910
1112131415