Вы находитесь на странице: 1из 1

TASK #3

Course: Introduction to Computer


Total Marks 20
Due date: 12th February, 2016

Question 1:
Write a function called hms_to_secs() that takes three int values—for hours, minutes, and
seconds—as arguments, and returns the equivalent time in seconds (type long). Create a program
that exercises this function by repeatedly obtaining a time value in hours, minutes, and seconds
from the user (format 12:59:59), calling the function, and displaying the value of seconds it returns.

Question 2:
Write a function called fact( ) it will take any int value and return its factorial.

NOTE:
 You are required to submit Hard & Soft copy of code.
 You will be required to demonstrate your logic & line by line execution.
 No excuse will be accepted for late submission.
Good luck

Вам также может понравиться