Print the pattern
How to print pattern
Here is the printing of the pattern of X
code:
//print the X pattren in the c programming language with steriek
#include <stdio.h>
int main()
{
int lines = 0;
int i = 0;
int j = 0;
lines = 9;
for (i = 0; i < (lines); i++){
for (j = 0; j < (lines); j++){
if ((i == j) || (i + j == lines - 1))
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
return 0;
}
Comments
Post a Comment