C Programming Tips & Tricks





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Code Snippets
 List All
 Arrays
 Calculators
 Datatypes
 Date & Time
 File Manipulation
 Math Functions
 Multimedia
 Others
 




Clock - C

Snippets  C  Clock
Snippet On
Clock




Code
  
Rate this page :
  [ 0 votes]

This program displays the current time.

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

int main()
{
struct tm *tmp;
time_t s;

for(;;)
{
s = time(NULL);
tmp = localtime(&t);

printf("%d:%0d:%d\n",tmp->tm_hour,tmp->tm_min,tmp->tm_sec);

Sleep(1000);

system ("cls");

}


return 0;
}




Other Links

web hosting