Wednesday, January 12, 2022

Present Date in C

 A simple program that I wrote to display the present date using a C programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.






Program Listing

#include <stdio.h> #include <time.h> /* Jake Rodriguez Pomperada, MAED-IT, MIT www.jakerpomperada.com and www.jakerpomperada.blogspot.com jakerpomperada@gmail.com */ const char *month_names[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; int main() { time_t now = time(NULL); struct tm *day = localtime(&now); printf("\n\n"); printf("\tPresent Date in C"); printf("\n\n"); printf("\tDate : %s\t%d, %d", month_names[day->tm_mon], day->tm_mday,day->tm_year+1900); printf("\n\n"); printf("\tEnd of Program"); printf("\n\n"); return 0; }

No comments:

Post a Comment