Thursday, 28 June 2018

number pattern

#include<stdio.h>
int main()
{
    int i,j,n;
    printf("enter the number");
    scanf("%d",&n);
    int l=n;
    for(i=0;i<n;i++)
    {
        int x=n;
        for(j=l;j>0;j--)
        {
            printf("%d",x);
            x--;
        }
        l--;
       
        printf("\n");
    }
    l=2;
    for(i=0;i<n-1;i++)
    {
        int x=n;
        for(j=1;j<=l;j++)
        {
            printf("%d",x);
            x--;
        }
        l++;
       
        printf("\n");
    }
   
    return 0;
}
output:
enter the number4
4321
432
43
4
43
432
4321


       

No comments:

Post a Comment

ASP.NET Core: How to implement Azure Active Directory (AAD) Authentication in ASP.NET Core

  In this tutorial, we will implement security for ASP.NET Core Application using Azure Active Directory (AAD).  In this tutorial, I will co...