Computer Science, asked by divansh1322, 2 months ago

write a program that calculates and print the number of seconds in a year​

Answers

Answered by anindyaadhikari13
3

\texttt{\textsf{\large{\underline{Solution}:}}}

The given co‎de is written in Python.

days=365

hours=24

mins=60

secs=60

no_of_seconds=days*hours*mins*secs

print("Number of seconds in a year:",no_of_seconds)

\texttt{\textsf{\large{\underline{Explanation}:}}}

  • A year has 365 days (except leap year). Each day has 24 hours. There are 60 minutes in an hour. There are 60 seconds in a minute. So, total seconds in a year would be - 365 * 24 * 60 * 60
  • So, in this way, the time is calculated.

See the attachment for output.


anindyaadhikari13: Thanks for the brainliest ^_^
Similar questions