#include <stdio.h>
#include "math.h"
#define N 1024
void main()
{
FILE *fp;
int i;
float s;
if((fp=fopen("d:\sindata1.txt","w"))==NULL)
{
printf("cannot open this file\n");
exit(0);
}
for(i=0;i<N;i++)
{
s=1+sin(asin(1)*4*i/N);
if(fmod(i,1)==0)
{
fprintf(fp,"\n");
}
fprintf(fp,"%4d:%4d;",i,(int)(s*511.5+0.5));
}
fprintf(fp,"\nEND;");
fclose(fp);
/*getch();*/
}