Disqus Shortname

Sunday, August 16, 2015

Program: Floyds Triangle



/*
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
16 17 18 19 20 21
22 23 24 25 26 27 28
*/

#include <stdio.h>

int main() {

int n, i, c, a = 1;

printf("Enter the number of rows of Floyd's triangle to print\n");
scanf("%d", &n);

for (i = 1; i
for (c = 1; c
printf("%d ", a);
a++;

}

printf("\n");
}

return 0;
}

/*-via Programming Hub for Android, a top rated Programming App on Google Play

https://play.google.com/store/apps/details?id=com.freeit.java*/


No comments:

Post a Comment