Traditional Culture Encyclopedia - Photography major - How to write sine wave in C language

How to write sine wave in C language

The source code is as follows:

# include # include # define EX 0.00000 1

# Define PI 3. 14 159265

int main()

{

double x=0.0,temp= 1.0,sin = 0.0

int I;

Printf ("Please enter degree:");

scanf("%lf ",& ampx);

x = x * PI/ 180;

temp = x; I = 0;

while ( fabs(temp)>EX)...{

sin+= temp;

I+= 2;

temp =(- 1)* temp * x * x/((I+ 1)*(I));

}

printf("sin(%lf) = %lf ",x,sin);

Printf ("the number is %d", i);

Returns 0;

}

Extended data

C language to write a program to output a box source code is as follows:

# Contains?

int? Master ()

{

int? I,j,n;

scanf("%d ",& ampn);

for(I = 0; I

printf(" * ");

Or what?

printf("? );

}

printf(" \ n ");

}

Return? 0; ?

}