Program to show present time and date in C-language

Program to show present time and date in C-language.

#include <stdio.h>
#include <string.h>
int main() {
  char time[10];
  char date[12];

  strcpy(time, __TIME__);
  strcpy(date, __DATE__);
  printf("%s %s\n", time, date);
  
  return 0;
}

OUTPUT
08:17:09 May 25 2020

The above time and date change according to you when you run the program,So it show different time.

If you like this program you can share comments and follow.

Comments

Popular posts

Creative pattern of butterfly in C-language

Introduction of C-language.

Variable & Datatype for C-programming

Program to see all ASCII value using for loop in C-language

Errors in C-language

Program to find the sum of two array into the third in C-language

Program to cheque enter number is even or odd in c-language

Binary searching in C-language

Syntax of C-language