Skip to content

Instantly share code, notes, and snippets.

@newtoallofthis123
Created January 13, 2023 07:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save newtoallofthis123/38d01cc5c579299aa6d919401b10683b to your computer and use it in GitHub Desktop.
Save newtoallofthis123/38d01cc5c579299aa6d919401b10683b to your computer and use it in GitHub Desktop.
C calculator for Hashnode Article
#include <stdio.h>
int main(int argc, char const *argv[])
{
int seconds, minutes, hours;
scanf("%d", &seconds);
hours = seconds / 3600;
minutes = (seconds % 3600) / 60;
seconds = (seconds % 3600) % 60;
printf("%d:%d:%d", hours, minutes, seconds);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment