Open Rejwan321 opened 6 months ago
// Print a pattern of numbers from to as shown below. Each of the numbers is separated by a single space. Hacker rank problem solve.
int main() { int n; scanf("%d", &n); int size = 2 * n - 1; int grid[size][size]; for (int i = 0; i < n; i++) { for (int j = i; j < size - i; j++) { for (int k = i; k < size - i; k++) { grid[j][k] = n - i; } } } for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { printf("%d", grid[i][j]); if (j < size - 1) { printf(" "); } } printf("\n"); } return 0; }
Please specify the problem you solved
Solve the C language codes in hacker rank and add your own solves to this repository. I will look over the code and tell you what changes to make.