Program to draw circle using C/C++,How to Draw Circle,Draw Circle in Graphics C / C++,Circle function in Graphics C/C++ (Hindi)
Program to draw circle using C/C++,How to Draw Circle,Draw Circle in Graphics C / C++,Circle function in Graphics C/C++ (Hindi)
![]() |
Program to Draw Circle in Graphics C / C++,Circle function in Graphics C/C++ (Hindi) |
Circle in c graphics (Hindi): नमस्ते दोस्तों स्वागत है आपका हम graphics c programming के सहायता से circle को draw करना सीखेंगे आज मैं आपको graphics के अंतर्गत circle function के बारे में बताऊंगा की कैसे grahics.h header file के circle function का उपयोग करके circle को draw कर सकते है और मैं आपको circle function से सम्बंधित program का उदाहरण भी बताऊंगा जिससे आप आसानी से circle function के बारे में जान सकते है तो चलिए हम देखते है |
Circle function in graphics c /c++ (HINDI):
circle() एक graphics c programming में उपस्थित एक library function है जिसका उपयोग circle का निर्माण करने के लिए किया जाता है circle को draw करने के लिए हमें तीन पैरामीटर को pass करना होता है सबसे पहले हमें x coordinate को defined होता है और फिर हमें y coordinate को defined करना पड़ता है और लास्ट में हमें circle का radius देना पड़ता है |
जैसे -
Syntax of Circle Function in graphics C/C++ (Hindi):
circle(x, y, radius);
Explain of the syntax :
उपरोक्त syntax में circle एक graphics.h में उपस्थित library function है और x तथा y coordinate है जसके सहायता से screen पर किस स्थान पर circle को draw करवाना है उसे defined कर सकते है और circle को कितना बड़ा बनाना हे उसके लिए radius में value को पास करना पड़ता है जैसे उदाहरण के लिए हमने value को circle function में pass लिया है |
circle(100 ,110 ,50);
यहाँ पर 100 x coordinate को indicate करता है तथा 110 y coordinate को indicate करता है और यहाँ पर 50 radius दिया गया है |
दोस्तों हमने coordinate को line को करने बाले प्रोग्राम में बतया था यदि आपने उसे नहीं देखा है तो दोस्तों आप पहले उस post को देख लीजिये जिससे आपको coordinate अच्छे से समझ में आ जायेगा और आप सर्किल को आसानी से बना सकते है |
दोस्तों हमने उदाहरण के लिए दो circle को defined किया है |
Example of circle 1 :
Input x = 250, y = 200, radius = 50
Output -
Example of circle 2 :
Input x = 300, y = 150, radius = 90
Output -
Program to Draw Circle Using graphics C/C++(Hindi):
// C graphics program (draw circle) C/C++
Explain of the Code-
उपरोक्त program में दोस्तो हमने सबसे पहले graphcs.h header file को include किया है जिसकी सहायता से हम graphics से सम्बंधित function को program में initialize करते है और उसी तरह हमने conio.h header file को भी include किया है फिर हमने main() function के अंतर्गत graphics driver और graphics mode को अपने प्रोग्राम में शामिल किया है उसके बाद हमने circle का निर्माण करने के लिए circle function के अंदर तीन peramiter को पास किया जिसमे x-coordinate का value 250 defined किया है उसी प्रकार y-coordinate का value 200 defined किया है जोकि screen पर किस स्थान पर circle draw करना है उसके position को defined करता है और हमने radius का value 50 दिया है जोकि circle के area को indicate करता है हमने
अगर दोस्तो आपको coordinate नहीं पता तो आप मेरी उस post को देख सकते हो जिमे मैंने coordinate को अच्छे के बताया है| अभी देखा draw circle in c graphics चलिए अब हम program के output को देखते है |
Output-
// C graphics program (draw circle) C/C++
#include<graphics.h>
#include<conio.h>
in main()
{
//graphich driver
int gd =DETECT, gm;
//lode of the graphics mode and graphics driver inside the program
initgraph(&gd, &gm, "" );
//using circle function
circle(250, 200, 50);
getch();
//close graphics mode
closegraph();
}
Explain of the Code-
उपरोक्त program में दोस्तो हमने सबसे पहले graphcs.h header file को include किया है जिसकी सहायता से हम graphics से सम्बंधित function को program में initialize करते है और उसी तरह हमने conio.h header file को भी include किया है फिर हमने main() function के अंतर्गत graphics driver और graphics mode को अपने प्रोग्राम में शामिल किया है उसके बाद हमने circle का निर्माण करने के लिए circle function के अंदर तीन peramiter को पास किया जिसमे x-coordinate का value 250 defined किया है उसी प्रकार y-coordinate का value 200 defined किया है जोकि screen पर किस स्थान पर circle draw करना है उसके position को defined करता है और हमने radius का value 50 दिया है जोकि circle के area को indicate करता है हमने
अगर दोस्तो आपको coordinate नहीं पता तो आप मेरी उस post को देख सकते हो जिमे मैंने coordinate को अच्छे के बताया है| अभी देखा draw circle in c graphics चलिए अब हम program के output को देखते है |
Output-
Program to draw circle in graphics c in Hindi
Graphics function in c language in Hindi:
line();
bar();
circle();
rectangle();
ellipse();
getcolor();
getmaxcolor();
getmaxx();
getmaxy();
outtextx();
outtexty();
outtextxy();
setbkcolor();
setfillstyle();
Conclusion:
दोस्तो हमने अभी देखा function of circle in c graphics ,what is circle in c graphics, How to draw circle using c graphics. अगर आपको दोस्तो यह post अच्छा लगा हो तो आप इसे share तथा comments करे और अगर कोई problem हो तो comments करके जरूर बताये |
COMMENTS