/* *This program illustrates how to compute the factorial of a given integer using a function. * * */ #include #include using namespace std ; unsigned int factorial ( unsigned int num ) { int i =1, fact; fact =i ; while(i<=num) { fact=fact*i; i++; } return fact ; //cout<<"The factorial is "<> num; //Calculate the factorial using loop cout << "the factorial is: " << factorial(num) << endl; return 0; }