Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Follow all instructions don't use past answers. Use c# Develop a program to compute N! using unsigned integer type of array to store; for a

image text in transcribed

Follow all instructions don't use past answers. Use c#

Develop a program to compute N! using unsigned integer type of array to store; for a N from 1 to 99,999,999. The result can be a very long number. For example, the factorial of 50 is: 30,414,093,201,713,378,043,612,608,166,064,768,844,377,641,568,960,512,000,000,000,000 In the main function, you ask user to enter factorial number N to compute and create unsigned integer type of an array with 5000 elements to store result of factorial number. Pass an array to the function by reference so that when execution returns from the function and an array will contain final factorials number. The function will compute N! and store into array with a maximum 4 digits per element. In order to solve this problem, you will initialize the first element of array that it contains 1! Before computing the factorial requested by the user. The factorial of zero and the factorial of one is one (2! is 2, 3! is 6, 4! is 24...etc). You need to design how you want to store number into array from 0 to 5000 element or 5000 to 0 element, which is very important when you design your display function. Write a function to compute the factorial of a number using the algorithm described in class. This should be as efficient as possible. You should store a maximum 4 digits per element and perform computation for large factorials. Write a function to display the factorial you computed. As you print the value in each element of array you will need to fill in leading zeros by printing character zeros if the digits in an element of the array (except for the beginning of the number) contains leading zeros. Do not print commas in the numbers as shown above. You can only display 60 characters per line. Print to the screen the factorial number you were computing, the number of digits in the value, and print all the digits in the number that was computed. After you have printed the results, as the user to input the next integer number to be used to compute a factorial. Terminate the program when the user enters a negative number. You should find out what is biggest factorial number that your program can compute and how long to finished (time)? Size of array could change

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions