Computer Scientists are Pretty Pessimistic

Thursday 10 September 2015

WAP to print the following series

5
54
543
5432
54321

Code ::

#include <stdio.h>
int main ()
{
    int i,j,n;
    printf("N= ");
    scanf("%d",&n);
    for(i=n;i>=1;i--)
    {
        for(j=n;j>=i;j--)
        {
            printf("%d",j);
        }
        printf("\n");
    }
    return 0;
}

No comments:

Post a Comment