Question
I need the answer very quickly make an c++ code Complete the following program such that the user enters 10 non-negative integer values in array
I need the answer very quickly
make an c++ code
Complete the following program such that the user enters 10 non-negative integer values in array INarr. The program is then required to count and print the number of array elements whose values equal the factorial of their respective indicies.
Notice that the factorial of an integer is the result of multiplying the number by every natural number below it until you reach 1. For example, the factorial of 4 = 4 x 3 x 2 x 1 = 24. Remember that factorial of 0 = 1.
Notice that the program must ignore any negative values entered by the user and store the first 10 non-negative integers eneterd in INarr.
Sample Testcase 2:
Input:
-120 2 2 2 6 2 2 2 2 2 2
Output:
2
Sample Testcase 3:
Input:
92 80 67 50 2 3 2 2 1 0
Output:
0
#include
int main() { int INarr [10];
// Your code starts here
// Your code ends here
return 0; }
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