Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
double a, b, c;
void test(int sig)
{
printf("%f\n", a * b + c);
}
int main(int argc, char *argv[])
{
a = argc;
b = atof(argv[1]);
c = atof(argv[2]);
signal(SIGUSR1, test);
for (int i = 1; i <= 1000; i++) {
printf("%f %f %f\n", a, b, c);
a += 1;
b *= i;
b -= 1;
sleep(1);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment