# include & ltstdio.h & gt
# include & lttime.h & gt
# include & ltstdlib.h & gt
int main()
{
int a = 0;
Srand ((unsigned) time (empty));
a = rand()% 40+ 1; /* Select one from 1 to 40 */
printf("%d\n ",a);
Returns 0;
}