انا بكرة طالبين مني الاسايمنت ده وعليه 20% من درجة المادة وانا بحاول احله لكن قافلة معايا خالص ياريت تقدروا تساعدوني وبسرعة
الاسايمنت كالتالي:- :sad:
1- Write a program that uses a function to calculate the factorial of a given number. (حاولت فيه وحليته)
________________________________________
2- Write a program that computes the power of a number, the program should first prompt the user to enter the base and the exponent and then passes them to the function power() which computes the power, then the result should be output in the main() function.
Sample execution:
Enter the base: 3
Enter the exponent: 2
3 ^ 2 = 9.
________________________________________
3- (Built-in functions)
Write a program that uses a function for calculating the square root of a number using the <cmah.h> library
4- Write a program that inputs a series of integers and passes them one at a time to function even, which uses the modulus operator to determine whether an integer is even. The function should take an integer argument and return true if the integer is even and false otherwise.
________________________________________
Sample Output
Enter an integer: 4
4 is an even integer
Enter an integer: 3
3 is an odd integer
Enter an integer: 2
2 is an even integer
_______________________________________
5. Write a function called circarea() that finds the area of a circle. It should take an argument of type float and return an argument of the same type. Write a main() function that gets a radius value from the user, calls circarea(), and displays the result.
________________________________________
6. 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.