Parabola

Description:           This program creates a graphic describing the path of parabola.

 
Primary Inputs:    (x,y) coordinates and value of a
Primary Output:    parabola
Platform Used:      Turbo C++ version 3.0, Borland International Inc.
 

#include
#include
#include
#include void main()
{
float x, y, a;
int gdriver=DETECT;
int gmode,i;
initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
printf("Enter the coordinates x and y:");
scanf("%f %f",&x, &y);
printf("Enter the value of a:");
scanf("%f", &a);
for(i=0;i<100;i++) { x = sqrt(4*a*(y+i)); putpixel(x, y+i, RED); } getch(); }

 

1/5 - (1 vote)

Leave a Reply