“Kompiler C online untuk grafik” Kode Jawaban

Kompiler C online untuk grafik

#include <stdio.h>
#include <conio.h>
#include <graphics.h>
#include <math.h>

int main() {
    int count = 1, gd = DETECT, gm;
    int x, y, dx, dy, inc, x1, y1, x2, y2;
    initgraph(&gd, &gm, "..\\BGI");

    printf("\nEnter Initial Line Coordinates: \n");
    printf("\nEnter the value of x1 and y1: \t");
    scanf("%d %d", &x1, &y1);

    printf("\nEnter Final Line Coordinates: \n");
    printf("\nEnter the value of x2 and y2: \t");
    scanf("%d %d", &x2, &y2);

    dx=abs(x2-x1);
    dy=abs(y2-y1);
    if(dx>=dy) {
        inc =dx;
    }
    else {
        inc =dy;
    }
    dx = dx/inc;
    dy = dy/inc;
    x = x1;
    y = y1;
    for(count = 1; count <= inc; count++) {
        putpixel(x, y, 4);
        x = x + dx;
        y = y + dy;
    }
    getch();
    closegraph();
    return 0;
}
Subhadip Mandal

Kompiler C online untuk grafik

#include<graphics.h>  
#include<conio.h>  
void main()  
{  
    intgd=DETECT, gm, i, x, y;  
    initgraph(&gd, &gm, "C:\\TC\\BGI");  
    x=getmaxx()/3;  
    y=getmaxx()/3;  
    setbkcolor(WHITE);  
    setcolor(BLUE);  
    for(i=1;i<=8;i++)  
          {  
        setfillstyle(i,i);  
        delay(20);  
        circle(x, y, i*20);  
        floodfill(x-2+i*20,y,BLUE);  
    }  
    getch();  
    closegraph();  
}  
Curious Crayfish

Kompiler C online untuk grafik

#include <conio.h> 
#include <graphics.h> 
#include <stdio.h>
void main() 
{
int gdriver = DETECT, gmode;
initgraph(&gdriver, &gmode, ""); 
line(100, 100, 150, 50); 
line(150, 50, 200, 100); 
line(150, 50, 350, 50); 
line(350, 50, 400, 100);
rectangle(100, 100, 200, 200); 
 rectangle(200, 100, 400, 200); 
rectangle(130, 130, 170, 200); 
 rectangle(250, 120, 350, 180); 
setfillstyle(2, 3); 
floodfill(131, 131, WHITE); 
floodfill(131, 131, WHITE); 
setfillstyle(11, 7);
floodfill(101, 101, WHITE); 
floodfill(150, 52, WHITE); 
floodfill(163, 55, WHITE);
floodfill(251, 121, WHITE);
closegraph(); 
}
Rich Rat

Kompiler C online untuk grafik

#include <conio.h>

#include <math.h>

#include <stdlib.h>

#include <graphics.h>

int main()

{

int x,y,r,midx, midy,color:

float t:

int gdriver=DETECT, gmode:

initgraph(&gdriver, &gmode, "CENNTUNNBGI");

midx=getmaxx()/2;

midy-getmaxy()/2;

r=10;

color=12;

setcolor (12);

setfillstyle (1,12);

settextstyle(0,0,3);

do

{

outtextxy(midx-220,35, "I LOVE PROGRAMMING"); outtextxy(midx-175, midy+180, "ROHIT TECH STUDY"); 

for(t=0;t<(2*M_PI);t+=0.01)

{

x=(r*16*sin(t)*sin(t)*sin(t))+midx

y=(r*(1-2)*(13*cos(t)-5*cos(2 t)-2*cos(3*t)-cos(4xt)))+(midy-30); pieslice(x,y,0,360,5);

pieslice(x,y,0,360,5);

}

floodfill(midx, midy,color); color=random(15)+1; setcolor (color); setfillstyle(1,color);

while (!kbhit());

getch();

closegraph();

return 0;

}

Bewildered Buzzard

Kompiler C online untuk grafik

#include<graphics.h>
void main()
{
int gmode = DETECT,gdriver;
initgraph(&gmode,&gdriver," C:\TurboC4\TC\BGI");
line(50,50,300,300);
getch();
}
Chethan Kumar

Kompiler C online untuk grafik

#include<graphics.h>
#include<stdio.h>
#include<conio.h>
Nader dwaik

Kompiler C online untuk grafik

#include<graphics.h>  
#include<conio.h>  
void main()  
{  
    intgd=DETECT, gm, i, x, y;  
    initgraph(&gd, &gm, "C:\\TC\\BGI");  
    x=getmaxx()/3;  
    y=getmaxx()/3;  
    setbkcolor(WHITE);  
    setcolor(BLUE);  
    for(i=1;i<=8;i++)  
          {  
        setfillstyle(i,i);  
        delay(20);  
        circle(x, y, i*20);  
        floodfill(x-2+i*20,y,BLUE);  
    }  
    getch();  
    closegraph();  
Angry Antelope

Kompiler C online untuk grafik

#include <conio.h> 
#include <graphics.h> 
#include <stdio.h>
void main() 
{
int gdriver = DETECT, gmode;
initgraph(&gdriver, &gmode, ""); 
line(100, 100, 150, 50); 
line(150, 50, 200, 100); 
line(150, 50, 350, 50); 
line(350, 50, 400, 100);
rectangle(100, 100, 200, 200); 
 rectangle(200, 100, 400, 200); 
rectangle(130, 130, 170, 200); 
 rectangle(250, 120, 350, 180); 
setfillstyle(2, 3); 
floodfill(131, 131, WHITE); 
floodfill(131, 131, WHITE); 
setfillstyle(11, 7);
floodfill(101, 101, WHITE); 
floodfill(150, 52, WHITE); 
floodfill(163, 55, WHITE);
floodfill(251, 121, WHITE);
closegraph(); 
}
Rich Rat

Kompiler C online untuk grafik

#include<graphics.h>
#include<stdio.h>
#include<conio.h>
void main(){
    int gd=DETECT,gm;
    int x,y;
    clrscr();
    printf("Enter adress of point  x,y    :");
    scanf("%d%d",&x,&y);
    clrscr();
    initgraph(&gd,&gm,"../bgi");
    putpixel(x,y,10);
    getch();
    closegraph();
}
Baddar Bukhari

Jawaban yang mirip dengan “Kompiler C online untuk grafik”

Pertanyaan yang mirip dengan “Kompiler C online untuk grafik”

Lebih banyak jawaban terkait untuk “Kompiler C online untuk grafik” di C

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya