Code:#include <iostream> using namespace std; int main() { unsigned long factorial = 1, number = 0; cout <<" Enter number " ; // entered 12 as number cin >> number; for ( int counter = number; counter >= 1; counter -- ) // post increment counter factorial *= counter; // value of counter is 12 * 12 ? cout << " " << factorial; // answer return 0; }
Hi i was wondering in the for structure where i have counter--.
And i have then counter * counter ,
does it multiply 12 * 12 ? or 12 * 11 and when does it get post decremented?
Thanks alot.



LinkBack URL
About LinkBacks



