Colours in Graphics.h
GCC - Graphics & Multimedia Lab - C++ Program
Source code:
#include<graphics.h> using namespace std; int main() { int i,j=1,k=0,gd=DETECT, gm,ych,xch; char* buf; char colours[18][15]={"BLACK","BLUE","GREEN","CYAN","RED","MAGENTA","BROWN","LIGHTGRAY","DARKGRAY","LIGHTBLUE","LIGHTGREEN","LIGHTCYAN","LIGHTRED","LIGHTMAGENTA","YELLOW","WHITE"}; initgraph(&gd, &gm,NULL); outtextxy(150,15, "Colours in Graphics.h."); ych=0;xch=0; for(i=0;i<8;i++) { setcolor(i); for(j=k;j<k+50;j++) { line(j+50,80,j+50,200); } k=j; outtextxy(xch+50,80+ych,colours[i]); ych+=15; xch+=50; } k=0;ych=0;xch=0; for(i=8;i<=15;i++) { setcolor(i); for(j=k;j<k+50;j++) { line(j+50,230,j+50,350); } k=j;outtextxy(xch+50,235+ych,colours[i]); ych+=15; xch+=50; } getch(); closegraph(); return 0; }
Output:
nn@linuxmint ~ $ g++ g5.cpp -lgraph gp5.cpp: In function ‘int main()’: gp5.cpp:11: warning: deprecated conversion from string constant to ‘char*’ nn@linuxmint ~ $ ./a.out a.out: ../../src/xcb_io.c:249: process_responses: Assertion `(((long) (dpy->last_request_read) - (long) (dpy->request)) <= 0)' failed. Aborted nn@linuxmint ~ $
This post is so helpful.Keep updating with more information
ReplyDeleteGraphic Design Courses in Mumbai
Graphic Designing in Ahmedabad
Graphic Design Courses in Kochi
Graphic Design Courses in Trivandrum
Graphic Design Courses in Kolkata
Great post shared I really need this post your blog is very useful to me. Visit my website to get best Information About Best IAS coaching in Bhandup.
ReplyDeleteBest IAS coaching in Bhandup
Top IAS coaching in Bhandup
Thank you for sharing such detailed Blog. I am learning a lot from you. Visit my website to get best Information About Best UPSC Coaching in Bangalore
ReplyDeleteBest UPSC Coaching in Bangalore
UPSC Coaching in Bangalore
Thank you for sharing such detailed Blog. I am learning a lot from you. Visit my website to get best Information About Top IAS coaching Institutes in Dadar
ReplyDeleteTop IAS coaching Institutes in Dadar
Best IAS coaching Institutes in Dadar
Thank you for sharing such detailed Blog. I am learning a lot from you. Visit my website to get best Information About Top MPSC Coaching Institutes in Andheri
ReplyDeleteBest UPSC Coaching Institute in Bhandup
Top UPSC Coaching Institute in Bhandup
Thank you for sharing such detailed Blog. I am learning a lot from you. Visit my website to get best Information About Best UPSC Coaching Institute in Bhandup
ReplyDeleteBest UPSC Coaching Institute in Bhandup
Top UPSC Coaching Institute in Bhandup
Our company offers a broad range of tests on blood test and other human body viscera. Contact us for more information about our test services.
ReplyDeletelab test near me
This is an awesome post. Really very informative and creative contents. Visit my website to get best Information About Best UPSC Coaching Institute in Mumbai.
ReplyDeleteBest UPSC Coaching Institute in Mumbai
Top UPSC Coaching Institute in Mumbai
Thanks for this post. It proves very informative for me. Great post to read. Visit my website to get best Information About Best UPSC Coaching Institute in Borivali.
ReplyDeleteBest UPSC Coaching Institute in Borivali
Top UPSC Coaching Institute in Borivali
Great post! I really enjoyed reading and found your insights to be quite valuable. I appreciate the way you presented your ideas. It made the content easy to follow and understand. Your writing style is engaging and makes the content enjoyable to read. I look forward to more posts. Thank you for sharing this informative article.If you are interested in knowing about the 10 Best IAS Coaching Centres in Ahmedabad.
ReplyDelete