Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update assignment5.c #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Assignment-05/assignment5.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include <stdio.h>

#include <stdio.h>

int main(void)
{
//initialize var
float seconds;

//get value for var
printf("Enter the amount of seconds: ");
printf("Enter the amount of seconds:\n");
scanf("%f", &seconds);

//initialize our arithmetic vars
Expand All @@ -24,7 +24,7 @@ int main(void)

//remaining_seconds is simply what's leftover
remaining_seconds = (seconds - (hours * 3600) - (mins * 60));
printf("%0.0f seconds is equal to %0.0f hours, %0.0f minutes, and %0.0f seconds.", seconds, hours, mins, remaining_seconds);
printf("\n%0.0f seconds is equal to %0.0f hours, %0.0f minutes, and %0.0f seconds.", seconds, hours, mins, remaining_seconds);

return 0;
}