C/DeitelC/Chapter4/test1.c
2024-06-17 03:24:07 +03:00

17 lines
404 B
C

#include <stdio.h>
int main()
{
int x, i, j;
// prompt user for input
printf("%s", "Enter an integer in the range 1-20:");
scanf("%d", &x); // read values for x
for (i = 1; i <= x; i++) { // count from 1 to x
for (j = 1; j <= x; j++) { // count from 1 to x
if (j==i)
printf("%c",'@'); // output @
else
printf(" ");
} // end inner for
printf("\n");
} // end outer for
} // end of main