Popular Posts

Saturday, November 28, 2015

Pyramid by number in C language

#include <stdio.h>

void main()
{
    int p, q, m, n;

    printf("\n How many line do you want: ");
    scanf("%d", &n);

    printf("\n\n");
    for ( p = 1; p <= n; p++)
    {
        for (q = 1; q <= (n-p); q++)
        {
          printf("     ");
        }
        m = p;
        for(q = 1; q <= p; q++)
        {
            printf("%5d", m++);
        }
        m -= 2;
        for( q = 1; q < p; q++)
        {
           printf("%5d", m--);
        }
    printf("\n");
    }
    return 0;
}

1 comment:

  1. What casino table games can I play at the Wynn in 2021? - JTM Hub
    There are three casinos at 김천 출장샵 Wynn in Las Vegas, as well as two — 속초 출장샵 The Venetian and the Wynn, two of which are among the most popular 오산 출장샵 at 서울특별 출장샵 Wynn Las Vegas. The other 고양 출장안마

    ReplyDelete