Requirements: Write a C program that will: a) Prompt the user for an integer b)
ID: 3654272 • Letter: R
Question
Requirements: Write a C program that will: a) Prompt the user for an integer b) Calculate the factorial for every number from 1 to the number the user entered c) Output the results to a file named _factorial.dat Example output: Enter an int: 10 1 factorial is 1 2 factorial is 2 3 factorial is 6 4 factorial is 24 5 factorial is 120 6 factorial is 720 7 factorial is 5040 8 factorial is 40320 9 factorial is 362880 10 factorial is 3628800 Must work from 1-20 I will only use positive integers from 1 to 20 (inclusive). So test for that You only have to prompt the user once (no loops needed).Explanation / Answer
#include #include void main() { int i,fact=1,n; clrscr(); printf(" Enter the no of terms ="); scanf("%d",&n); for(i=1;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.