0
How write a program to prompt the user to to enter to enter time in seconds. The program then displays it in minutes and seconds
//what I have done so far int seconds, minutes; Console.Write("Seconds: "); seconds = int.Parse(Console.ReadLine()); minutes = seconds / 60; seconds = seconds % 60; Console.ReadLine();
5 odpowiedzi
+ 3
To add to @Sneeze suggestion, you can try this:
Console.WriteLine("Time: {0:0#}:{1:0#}",minutes,seconds);
Hth, cmiiw
+ 1
You have the data, you want to show.
use Console.WriteLine to display the data.
use a placeholder to use the variables in the write statement.
Console.Writeline (the value is {0} , x);
{0} is the placeholder
x is the variable
https://www.dotnetperls.com/console
0
Looks good.
What is your question ?
Where do you get stuck ?
0
The question is " How write a program to prompt the user to to enter to enter time in seconds. The program then displays it in minutes and seconds"
I just need help displaying how to calculate the answer input by the user say example if a inputs 250seconds. I need help display the output as 01:10
0
it worked, thanks way better than stack flow