#WSQ09<\/a> #TC1017<\/a><\/p>\n <\/p>\n Factorial Calculator:<\/p>\n A Factorial calculator it´s defined as a calculation of the factorial. This is represented as the Multiplication of the composition of the number given. For example: If you want to calculate the factorial of 4! you should multiply 4*3*2*1=24. In a C++ programm it´s required to do a loop for making a programm that can calculate the factorial of a given number. The first thing required it´s making the structure of your programm, libraries (basic libraries), using namespace std; , int main ( ) { }, and then inside the main a loop indicating the start and the end of it it´s required. Notice that i has to be lower than 1 to define the work time of the loop. A new integer it´s required to save the result of the multiplications. On the example code it´s defined as factorial. Notice that the factorial it´s equal to the given number because the multiplication has to start with a number lower than the given number, example 4 (given number) 3 (begin of the multiplication so, the loop will do the follow equation: 4*3*2*1.<\/p>\n <\/p>\n <\/p>\n Example code:<\/p>\n #include<\/a> <iostream><\/p>\n using namespace std;<\/p>\n <\/p>\n <\/p>\n int main ()<\/p>\n {<\/p>\n char A;<\/p>\n do<\/p>\n {<\/p>\n int n,factorial;<\/p>\n <\/p>\n cout << “This program will display the factorial of a given number, Enjoy.”<< endl;<\/p>\n cout << “Give me the number: “<< endl;<\/p>\n cin >> n;<\/p>\n <\/p>\n factorial=n;<\/p>\n for (int i=n; i>1; i–)<\/p>\n {<\/p>\n factorial= factorial * i ;<\/p>\n }<\/p>\n <\/p>\n cout << “The factorial of the given number is: ” << factorial << endl;<\/p>\n cout << “Would you like to repeat the program? Y\/N” << endl;<\/p>\n cin >> A;<\/p>\n }while (A == ‘Y’);<\/p>\n <\/p>\n cout << “Thanks for using this program. Have a nice day “<< endl;<\/p>\n return 0;<\/p>\n <\/p>\n }<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":" #WSQ09 #TC1017 Factorial Calculator:A Factorial calculator it´s defined as a calculation of the factorial. This is represented as the Multiplication of the composition of the number given. For example: If you want to calculate the f… Continue reading