The aim of this question is to ensure that you are able to write C language code that carries out recursive computations by using loops. Before attempting to solve this problem, please study the loop programming exercises on this link: https://codeforwin.org/c-programming/for-do-while-loop-programming-exercises. Write C program that will prompt the user for an integer n. If the user has entered a non-integer, the user must be prompted again until he or she enters an integer. If he enters non-integer numbers five times, the program must inform the user the following message ‘You have entered non-integers on five occasions, now the program is exiting” before coming to an end. On the other hand, if the user enters an integer n, the program must compute the sum of three consecutive factorials S=n!+(n+1)!+(n+2)! . Your program must print the resulting sum on the display.
The aim of this question is to ensure that you are able to write C language code
that carries out recursive computations by using loops. Before attempting to solve
this problem, please study the loop
https://codeforwin.org/c-programming/for-do-while-loop-programming-exercises.
Write C program that will prompt the user for an integer n. If the user has
entered a non-integer, the user must be prompted again until he or she enters an
integer. If he enters non-integer numbers five times, the program must inform the
user the following message
‘You have entered non-integers on five occasions, now the program is exiting”
before coming to an end.
On the other hand, if the user enters an integer n, the program must compute the
sum of three consecutive factorials S=n!+(n+1)!+(n+2)! . Your program must
print the resulting sum on the display.
Step by step
Solved in 3 steps with 3 images