calculate the number of minutes in a year.

I need help with my c++ university assignment the assignment want us to write a code that calculate the number of minutes in a year can u help me please?
Can you demonstrate the mathematical calculation to determine the number of minutes in a year?

One possible way out of many is to determine:
How many days are in a year?
How many hours are in a day?
How many minutes are in a hour?

Then:
(Answer of num of minutes in a hour) * (Answer of num of hours in a day)
Once you get an answer, then multiply by the number of days in a year.

Again, it is just one way (out of many) to solve the problem.

Write the codes in the screenshot: http://prntscr.com/mmw3yp

I made in CodeLite, some codes may need to be different depending on your IDE

If doesn't work, try:

change

int main() {

}

to


int main(int argc, char *argv[]) {

}

I think this will be enough. But next time try to do it yourself in order to get a job in future.
minutes/year = minutes/hour * hours/day * days/year
why would he need command line args for this?

as with any program, there are lots of ways to do it. You can also just subtract a couple of dates and ask the computer for the answer, which is the c++ approach (let the built in tools do it for you).
Topic archived. No new replies allowed.