Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6866745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:13:25+00:00 2026-05-27T03:13:25+00:00

Write a program to simulate simple digital clock displaying HOURS(s) : MINUTES(s): SECOND(s) How

  • 0

Write a program to simulate simple digital clock displaying

HOURS(s) : MINUTES(s): SECOND(s)

  • How to get local system time ?

  • How to split local system time into hours , minutes and seconds ?

Edit 1:

This is what I have tried, but its far from perfect (dosnt even use time.h)

     #include <stdio.h>
     #include <conio.h>
     #include <dos.h> void main() { int h,m,s; h=0; m=0; s=0; while(1) {

     if(s>59) {m=m+1; s=0; } 
      if(m>59) { h=h+1; m=0; } 
      if(h>11) { h=0; m=0; s=0; } 
      delay(1000); 
      s=s+1; 
      clrscr(); 
      printf("\n DIGITAL CLOCK");
      printf("\n HOUR:MINUTE:SECOND"); 
      printf("\n%d:%d:%d",h,m,s); 
}

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:13:25+00:00Added an answer on May 27, 2026 at 3:13 am

    How to get local system time ?
    How to split local system time into hours , minutes and seconds ?

    time.h

    #include <stdio.h>
    #include <time.h>
    
    int main(void) {
    
        time_t rawtime;
        struct tm*  time_;
    
        time(&rawtime);
        time_ = localtime(&rawtime);
    
        printf("%i:%i:%i %i %i %i\n", time_->tm_hour, time_->tm_min, 
                time_->tm_sec, time_->tm_mday, time_->tm_mon+1,
                time_->tm_year+1900);
    
        return 0;
    }
    

    Why did I do +1900 and +1 you can read here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to learn Haskell, so I decided to write a simple program to
I have to write a program (perl , python or java) to simulate workload
I am trying to write a program to simulate a card game. I have
I am trying to write a very simple script that would simulate a pocket
I tried a simple file write program in Android. try { //File f1=new File(/sdcard/Prag.txt);
I'm willing to write program that after 5 sec shows text that was hidden
Write a program to determine whether a computer is big-endian or little-endian. bool endianness()
I write a program to delete a file from somewhere of my harddisk in
I need to write a program used internally where different users will have different
Sometimes whenever I write a program in Linux and it crashes due to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.