/* Print a sinewave graph */ #include #include #define PI 3.14159265358973 #define STEPS 16 #define SIZE 15 int step; void sineline (void); main () { for (step=0; step<=STEPS; step=step+1) { sineline(); } } void sineline (void) { float angle; int indent; angle = (2*PI) * step / STEPS; indent = 5.5 + SIZE + SIZE * sin(angle); printf ("%*c\n", indent, '*'); }