Skip to content

Instantly share code, notes, and snippets.

@pi0
Created November 10, 2014 18:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save pi0/fba53e30d53f4a7a6c37 to your computer and use it in GitHub Desktop.
ConsoleSinPlot.c
#include <stdio.h>
#include <math.h>
#include <conio.h>
int main()
{
int i, j, val;
for (j = 0; j < 25; j++) {
val = 10 + 10.0*sin(2 * 3.14*j / 24);
for (i = 0; i <val && i<10; i++)
printf(" ");
for (; i == 10; i++)
printf(" .");
for (; i <val ; i++)
printf(" ");
printf("* ");
for (; i < 10;i++)
printf(" ");
for (; i == 10; i++)
printf(". ");
for (; i < 20;i++)
printf(" ");
printf("\n");
}
_getch();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment