Pattern 2

mail@pastecode.io avatar
unknown
c_cpp
a month ago
407 B
11
Indexable
Never
// Online C compiler to run C program online
#include <stdio.h>

int main()
{
    int n, y;
    printf("Enter Value Of n \n");
    scanf("%d", &n);

    printf("Enter Value Of y \n");
    scanf("%d", &y);

    for (int i = 0; i < n-1; i++)
    {
        if (i == y - 1)
            printf("\n");
        for (int j = 0; j < n; j++)
        {
            printf("* ");
        }
        printf("\n");
    }
}
Leave a Comment