0% found this document useful (0 votes)
5 views1 page

C Program Notes

The document contains a C program that implements graphics functions to draw a hut and a man with an umbrella. It defines the screen dimensions and uses various graphics functions to create shapes and fill colors. The code includes functions for drawing the hut and the man with an umbrella, but contains some syntax errors and incomplete statements.

Uploaded by

GARENA GOD GAMER
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

C Program Notes

The document contains a C program that implements graphics functions to draw a hut and a man with an umbrella. It defines the screen dimensions and uses various graphics functions to create shapes and fill colors. The code includes functions for drawing the hut and the man with an umbrella, but contains some syntax errors and incomplete statements.

Uploaded by

GARENA GOD GAMER
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

//c program to implement

// the above approach


#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#define ScreenWidth getmaxx()
#define ScreenHeight getmaxy()
#define GroundY ScreenHeight*0.75 int Idisp = 0;

// Creating a hut
void hut()
{
setcolor(WHITE);
rectangle(150, 180, 250, 300);
rectangle(250, 180, 420, 300);
rectangle(180, 250, 220, 300);

line(200, 100, 150, 180);


line(200, 100, 250, 180);
line(200, 100, 370, 100);
line(370, 100, 420, 180);

setfillstyle(SOLID_FILL, BROWN);
floodfill(152, 182, WHITE);
floodfill(252, 182, WHITE);
setfillstyle(SLASH_FILL, BLUE);
floodfill(182, 252, WHITE);
setfillstyle(HATCH_FILL, GREEN);
floodfill(200, 105, WHITE);
floodfill(210, 105, WHITE);
}
//Drawing a Man With
// an umbrella
void DrawManAndUmbrella(int x, itn Idisp)
{
circle(x, GroundY - 90, 10);
line(x, GroundY - 80,x,Ground - 30);
line(x,GroundY - 70, x + 10, GroundY - 60);
line(x, GroundY - 65, x + 10, GroundY - 55);
line(x+10, GroundY - 60, x + 20, GroundY - 70);
line(x + 10, GroundY - 55, x + 20, GroundY - 70);

line(x, GroundY - 30,x + Idisp, GroundY);


line(x, GroundY - 30, x - Idisp, GroundY);

pieslice( + 20, GroundY - 120, 0, 180)


}

You might also like