-->

C program to print square numeric pattern

/**
 * C program to print square numeric pattern
   0 2 0 2 0
   0 2 0 2 0
   0 2 0 2 0
   0 2 0 2 0
   0 2 0 2 0

 */
#include <stdio.h>
#include<conio.h>
void main()
{
    int i, j, N;

    /* Input number of rows from user */
    printf("Enter number of rows: ");
    scanf("%d", &N);

    /* Iterate over each row */
    for(i=1; i<=N; i++)
    {
                /* Print given number in next line */
                printf("0 2 0 2 0\n");
   
    }

    getch();
}

No comments:

Post a Comment