-->
Showing posts with label C program to print square numeric pattern. Show all posts
Showing posts with label C program to print square numeric pattern. Show all posts

C program to print square numeric pattern 12345

**
 * C program to print square numeric pattern
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5

1 2 3 4 5

1 2 3 4 5

 */
#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("1 2 3 4 5\n");
   
    }

    getch();
}

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();
}