Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  test.c
Language: C/C++
Code:
#include <stdio.h>
 
int main()
{
    int N, i, j;
 
    printf("Enter N: ");
    scanf("%d", &N);
 
    for(i=1; i<=N; i++)
    {
        //Prints first part
        for(j=i; j>1; j--)
        {
            printf("%d", j);
        }
 
        //Prints second part
        for(j=1; j<= (N-i +1); j++)
        {
            printf("%d", j);
        }
 
        printf("\n");
    }
 
    return 0;
}
          
Comments: