wonder if you can help, im trying to compile this piece of code..
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n, r;
double s, spike;
n = 0
r = rand()*40/RAND_MAX + 10;
while (scanf ("%lg", &s) !=EOF)
{
if (n == r)
{
spike = (double)rand() *30.0 / RAND_MAX - 15.0;
printf ("%lg\n", spike);
n = 0;
r= rand()*40/RAND_MAX + 10;
}
else
{
printf("%lg\n",s)
n = n+1;
}
}
}
im getting the following errors:
line 12: error 1000: unexpected symbol: "r"
line 30: error 1000: unexpected symbol: "n"
error 1764: declarations as statements only with ansi_extend option.
its probably a really easy problem to fix but im very new to C!
any help appreciated