Hacking with ANSI C signal Handling

$sudo strace -e trace=signal -p 1 
[sudo] password for jeffrin: 
Process 1 attached
kill(4659, SIGTERM)                     = 0
kill(4659, SIGCONT)                     = 0

$gcc crtlc1-p1.c 
$./a.out 
Hello world 
Hello world 
Hello world 
Hello world 
Hello world 
Hello world 
Hello world 
Hello world 
Hello world 
^Ci got a signal 2
Hello world 
Hello world 
^C
$cat crtlc1-p1.c 
#include 
#include 
#include 

void ouch(int sig)
{

  printf("i got a signal %d\n",sig);
  (void) signal(SIGINT, SIG_DFL);
}

int main()
{

  (void) signal(SIGINT,ouch);

  while(1)
    {
      printf("Hello world \n");
      sleep(1);
    }
}
$