Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

C Exercise 56

C Exercise 56

100 Classic C Language Examples 100 Classic C Language Examples

**Problem:** Draw graphics; learn to use circle to draw a circle.

**Analysis:** None.

// Created by www.runoob.com on 15/11/9. // Copyright (c) 2015 Runoob Tutorial. All rights reserved. //

Example

#include

<

graphics.h

// It cannot run in VC6.0; it must run in Turbo2.0/3.0

int

main

(

)

{

int

driver

,

mode

,

i

;

float

j

=

1

,

k

=

1

;

driver

=

VGA

;

mode

=

VGAHI

;

initgraph

(

&

driver

,&

mode

,

"

"

)

;

setbkcolor

(

YELLOW

)

;

for

(

i

=

0

;

i

<=

25

;

i

++

)

{

setcolor

(

8

)

;

circle

(

310

,

250

,

k

)

;

k

=

k

j

;

j

=

j

0

.3

;

}

return

0

;

}

100 Classic C Language Examples 100 Classic C Language Examples