i want to print a sin wave but my program just prints a line help!!!!!!!!

Code:

`#include <iostream>`

#include <math.h>

#include "myconsole.h"

using namespace std;

int main ()

{

int x,i;

float y;

ClearScreen ();

x=0;

y=30;

PlaceCursor (x,y);

for (i=0;i<=40;i++)

{

y = sin(x);

y=y-(10);

PlaceCursor(x,y);

cout <<".";

x=x+10;

}

}

thanks i got it here is my code to move 5 stars on the curve neeeeeed help

as i have set the max range of x as 2PI i.e 6.28 so in order to move the stars from beggining again i had to set if (x>=6) but on the first cycle it prints 4 stars in the last half cycle then in the next cycle it prints two in the end then 5 ,then 3,then1 how to fix this???

Code:

`#include <iostream>`

#include <math.h>

#include "myconsole.h"

#include <windows.h>

using namespace std;

int main ()

{

double x,y;

int ax,by;

int counter=0;

ClearScreen ();

for (x=0;x<=6.28;x=x+0.348)// increments x axis by 10 degrees

{

y = sin(x)*10;

ax=(x*10)/1; //stores an integer value

by=(y/1)+15;//magnifies output along y axis

PlaceCursor(ax,by);

cout <<"*";

counter=counter+1;

if (counter%5==0)

{Sleep(1000);

ClearScreen ();

}

if (x>=6)

{

x=0;

}

}