Take what you have above, and REPRESENT it through the use of a loop.
Code:
/* Printing some lines, Adak
if (size == 6)
{
printf("1 * * * * *\n");
printf("6 2 * * * *\n");
printf("6 6 3 * * *\n");
printf("6 6 6 4 * *\n");
printf("6 6 6 6 5 *\n");
printf("6 6 6 6 6 6\n");
}
*/
#include <stdio.h>
int main(void) {
int i, j, k, size, totalsize, number, gar;
totalsize = 6;
printf("\n");
//Outer for loop represents and controls the total number of sets to be printed
for(k = 1; k <= totalsize; k++) {
size = k;
printf("\n");
//This for loop represents the total number of lines to be printed, in each
//set size, and the width of that line, in char's.
for(i = 1; i <= size; i++) {
for(j = size-1; j > size - i; --j) //controls printing set size number
printf("%d ", size);
printf("%d ", i); //prints the last digit of each line
for(j = 1; j <= size - i; j++) //controls the asterisks
printf("* ");
printf("\n");
}
}
printf("\n\n Press Enter to Quit ");
gar = getchar(); gar++;
return 0;
}