Thanks for your reply sir, i tried by giving some sleep in the main only.
using namespace std;
extern "C" void *print_message(void *);
void *print_message(void *)
printf("Going to sleep\n");
printf("creating the thread now\n");
value = pthread_create(&thread1, NULL, print_message, NULL);
printf("came back from thread\n");
and now it is working properly, it will go into the print_message method, waits there for 10secs meanwhile 10 secs will be elapsed in the main() also. So after coming out from print_message() method it wait for another 10secs so totally it will complete 20 secs and the program will terminate.
Raghavendra. H. R