Description: This program creates a sine curve
Primary Inputs: —–
Primary Output: A sine curve for prespecifed parameters.
Platform Used: Turbo C++ version 3.0, Borland International Inc.
/*This program generates the sine curve for prespecified parameters. */
#include
#include
#include
#include
void main()
{
int gdriver=DETECT,gmode,i;
float x=0;
clrscr();
initgraph(&gdriver,&gmode,"c:\\tc\\bgi");
for(i=0;i<360;i++)
{
double y1=sin(i*(3.14/180));
int y=y1*50;
putpixel(100+x,200-y,BLUE);
x=x+0.5;
delay(50);
}
getch();
}