C language or programminng -
can me print out following characters:
* ******** ** ******* *** ****** **** ***** ***** **** ****** *** ******* ** ******** *
that's code:
#include <stdio.h> int main(void) { int row; int column; // fig : (row=1;row<=7;row++) { (column=1;column<=row;column++) printf("*"); printf("\n"); } printf("\n"); }
you not printing upper right part. change loops print *
remaining number if subtract row
7
for (row = 1; row <= 7; row++) { (column = 1; column <= row; column++) putchar('*'); putchar(' '); (column = row; column <= 7; column++) putchar('*'); putchar('\n'); }
Comments
Post a Comment