#include #include #include #include using namespace std; int main(int argc, char *argv[] ) { //calculated the factorial int n,i,ans; if(argc>1){ n=(int)atof(argv[1]); } else{ n = 1; } i=1; ans=i; while(i<=n){ ans=ans*i; cout << i << "\t" << ans << endl; i++; //i++ is same as i=i+1 } cout << n<<"! = "<