Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi! I need help coding this in C language please! I also included the skeleton he gave us for it. If you're going to write
Hi! I need help coding this in C language please! I also included the skeleton he gave us for it. If you're going to write this in something other than C language please don't, as this class is just in C.
Thank you!!
2. Create a user defined function that calculates the factorial of a given integer. (with pointers) Your program should accomplish the following: a. You must create a user defined function, with two inputs: an integer pointer and an integer. -The integer pointer points to the location where the factorial result will be stored. -The integer input will be the value of n. b. In the main, ask user for the value of n, then call the function in the main program to calculate the factorial and print to screen. c. Inside of your user defined function, calculate the factorial utilizing a loop. Your function should modify the value by reference using pointers. Start your loop at 1 , and set the initial value of the factorial to 1 (Due to: 0!=1 ). REMEMBER: "*" = "value at", "\&" = "address of" d. Code should be uploaded as a .txt file, with a screenshot of your console showing your factorial output. e. Provide comments on the basic structure of your loop and how it calculates the factorial
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started