I have to display the message only for a specific time. After that it should be erased from the display. how to do this program in c.

this i wrote for linux what is your platform ? my ubuntu - gcc

#include <time.h>
#include <stdio.h>

int main()
   time_t startSeconds;

   startSeconds = time(NULL);

      system("clear");//platform specific check your platform this is linux/unix
      printf("%ld \n", time(NULL) - startSeconds);
      sleep(1);//platform specific check your platform and change this is linux/unix
   return 0;