Friday, November 30, 2018

Creating China Flag In Turbo C++ Codes

How to Create China Flag In C++ 


In this blog you will learn about how to create China Flag in C++ by using its Codes and then it will Show you the Flag on its Black Screen...

Step1; Open Turbo C++ program in your PC
Step2; Now write or Copy the following codes into the C++ 

#include<conio.h>
#include<graphics.h>
void main()
{
int driver=DETECT,mode;
initgraph(&driver,&mode,"c:\\turboc3\\bgi");
setfillstyle(1,RED);
bar(50,50,550,350);
line(130,100,120,130);
line(130,100,140,130);
line(120,130,90,130);
line(140,130,170,130);
line(90,130,113,150);
line(170,130,147,150);
line(113,150,103,180);
line(147,150,157,180);
line(103,180,130,160);
line(157,180,130,160);//big star

line(220,80,205,110);
line(220,80,225,110);
line(205,110,235,90);
line(225,110,200,90);
line(235,90,200,90);//second star

line(220,200,205,230);
line(220,200,225,230);
line(205,230,235,210);
line(225,230,200,210);
line(235,210,200,210);//third star

line(260,120,245,150);
line(260,120,265,150);
line(245,150,275,130);
line(265,150,240,130);
line(275,130,240,130);//fourth star

line(260,160,245,190);
line(260,160,265,190);
line(245,190,275,170);
line(265,190,240,170);
line(275,170,240,170);//fifth star




getch();
closegraph();
}

Step3; Now Compile (ctrl+F9) the Program and you will get the Flag of China on your Screen...



No comments:

Post a Comment

Making Gif of the images using MATLAB In this tutorial you will learn about how to make Gif  of the images while they are kept in One ...