Search

6.CIRCLE

CIRCLEआज के इस Advance Learning Tutorial में हम Graphics की हेल्प से Circle draw करना सीखेंगे।Circle बनाने के लिए हमे दो बाते धीयन रखनी होंगी ।1)  Center of the circle.2)  Radius of the circle.C programming में circle draw करने के लिए सबसे पहले graphics.h header file को अपने प्रोग्राम में include करे ।C में circle draw करने के लिए 1 function दिया गया है जिसका prototype इस तरह हैvoid circle (int x, int y, int radius)यंहा पर x  एंड y circle के center point है |उदाहरण के लिए program देखे ।#include<graphics.h>#include<conio.h>void main(){int gd=DETECT,gm;initgraph(&gd,&gm,"");circle(100,100,50);getch();closegraph();}धीयन रहे की circle function कोई भी value returnनहीं करता ।इसी प्रकार यदि आप circle के अंदर  एक और circle draw करना चाहते है तो circle function को दो बारकॉल कीजिये । लेकिन धीयन रहे की पहले वाले circle की radius दूसरे वाले circle की radius से बड़ी हो और सेंटर दोनों circle का same ही हो ।circle (100,100,50);circle (100,100,25);Circle function में आप जो भी value पास करते है वह pixel form में होती है ।आगे सीखे Rectangle in C  Graphics.

Share this

Related Posts

Previous
Next Post »

Thnx