Write a C program that does not terminate when Ctrl+C is pressed

/* A C program that does not terminate when Ctrl+C is pressed */
#include
#include

void sigintHandler(int sig_num){

printf("Cannot be terminated using Ctrl+C \n");
fflush(stdout);
signal(SIGINT,sigintHandler);

}


int main ()
{

    signal(SIGINT,sigintHandler);
while(1){}
    return 0;
}

Comments