Latest web development tutorials

C Exercise Example 10

100 cases of classic C language 100 cases of classic C language

Title: Print staircase, while at the top of the stairs to print two faces.

Program Analysis: The ASCII 1 to output Smile; with i-line control, j to control column, j i according to changes to control the output of the number of black squares.

If garbled Please refer to the blog [C Exercise Example 7] solution.

Source Code:

//  Created by www.w3big.com on 15/11/9.
//  Copyright © 2015年 本教程. All rights reserved.
//

#include<stdio.h>

int main()
{
    int i,j;
    printf("\1\1\n"); /*输出两个笑脸*/
    for(i=1;i<11;i++)
    {
        for(j=1;j<=i;j++)
            printf("%c%c",219,219);
        printf("\n");
    }
    return 0;
}

The above example output is:

100 cases of classic C language 100 cases of classic C language