ahmed0saber

Digital clock in C++

Nov 4th, 2020
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. #include <time.h>
  4. int main()
  5. {
  6.     time_t s, val = 1;
  7.     struct tm* current_time;
  8.  
  9.     s = time(NULL);
  10.  
  11.     current_time = localtime(&s);
  12.  
  13.     cout<<current_time->tm_hour<<":"<<current_time->tm_min<<":"<<current_time->tm_sec;
  14.  
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment