i'm writing a C program in unix that take a number upto 5 and creates that amount of threads..if the use doesn't enter anything the program quits after 5 secs...and this is where i'm stuck T_T ..how do i do this ? time.h ? code of wat i've done so far.
#include <errno.h>
#include <pthread.h>
#include <stdarg.h>
#include <stdio.h>
void main()
{
int i;
int j;
printf("enter the amount of threads ! max 5 \n");
scanf("%d",&i);
while (1)
{
if(i>5)
{
printf("please enter a nunmber less than 5\n");
scanf("%d",&i);
}
else
{
break;
}
}
}