close

Write a program that utilizes looping to produce the following table of values:

*******************

A    A+2    A+4    A+6
3      5     7      9
6      8    10     12
9     11    13     15
12    14    16     18
15    17    19     21

********************

 

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int num = 3;
    char a = 'A';
    printf("%c\t%c+2\t%c+4\t%c+6\t\n",a,a,a,a);
    
    for ( int i = 1; i <= 5; i++ )
    {
        num = 3;
        num = num * i;
        printf("%d\t",num);
        for ( int j = 1; j < 4; j++ )
        {
            
            num = num + 2;
            printf("%d\t",num);
        }
        printf("\n");
    }
    system("PAUSE");
    return 0;
}

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 Icen Zhong 的頭像
    Icen Zhong

    無止盡的Coding地獄

    Icen Zhong 發表在 痞客邦 留言(0) 人氣()