Introduction
In C programming, the standard library provides some functions to handle date and time manipulation. In this lab, we will learn how to display the current date and time using the ctime
function.
Note: You need to create the file ~/project/main.c
yourself to practice coding and learn how to compile and run it using gcc.
cd ~/project
## create main.c
touch main.c
## compile main.c
gcc main.c -o main
## run main
./main
Skills Graph
%%%%{init: {'theme':'neutral'}}%%%%
flowchart RL
c(("`C`")) -.-> c/UserInteractionGroup(["`User Interaction`"])
c(("`C`")) -.-> c/BasicsGroup(["`Basics`"])
c(("`C`")) -.-> c/PointersandMemoryGroup(["`Pointers and Memory`"])
c(("`C`")) -.-> c/FunctionsGroup(["`Functions`"])
c/UserInteractionGroup -.-> c/output("`Output`")
c/BasicsGroup -.-> c/data_types("`Data Types`")
c/BasicsGroup -.-> c/operators("`Operators`")
c/PointersandMemoryGroup -.-> c/memory_address("`Memory Address`")
c/FunctionsGroup -.-> c/function_declaration("`Function Declaration`")
subgraph Lab Skills
c/output -.-> lab-123236{{"`Display Current Date and Time`"}}
c/data_types -.-> lab-123236{{"`Display Current Date and Time`"}}
c/operators -.-> lab-123236{{"`Display Current Date and Time`"}}
c/memory_address -.-> lab-123236{{"`Display Current Date and Time`"}}
c/function_declaration -.-> lab-123236{{"`Display Current Date and Time`"}}
end