Latest web development tutorials

C Exercise Example 62

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

Title: Learning putpixel draw points, (implemented in the TC).

Program Analysis: None.

Source Code:

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

#include "stdio.h"
#include "graphics.h"
int main()
{
    int i,j,driver=VGA,mode=VGAHI;
    initgraph(&driver,&mode,"");
    setbkcolor(YELLOW);
    for(i=50;i<=230;i+=20)
        for(j=50;j<=230;j++)
            putpixel(i,j,1);
    for(j=50;j<=230;j+=20)
        for(i=50;i<=230;i++)
            putpixel(i,j,1);
}

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