Flag of Norway on C or C++ .cpp programming language by using c graphics library functions

 Write a C program to Draw the Flag of Norway.

Function Name :  Draw the Flag of Norway

Purpose :  In this Program we will learn how to draw the Norway flag on the output screen in c programming language by using c graphics library functions.

Code : 


#include<graphics.h> #include<conio.h> main() { int driver,mode; driver=DETECT; mode=0; initgraph(&driver,&mode,"c:\\tc\\bgi"); initgraph(&driver,&mode,""); setbkcolor(WHITE); setcolor(WHITE); rectangle(150,40,430,180); setfillstyle(1,RED); floodfill(160,50,WHITE); setfillstyle(1,WHITE); bar(150,90,430,130); setfillstyle(1,WHITE); bar(230,40,270,180); setfillstyle(1,BLUE); bar(150,100,430,120); setfillstyle(1,BLUE); bar(240,40,260,180); getch(); }



Output:

No comments:

Post a Comment

Max Sub Array Sum: Kadane's Algorithm

Code of: Max Sub Array Sum: Kadane's Algorithm. public class MaxSubArraySumKadanesALgorithm {     public static void Kadane ( int ...