You are on page 1of 1

Dietel and Dietel Exercise Solution 2.

45
============================================
#include<iostream.h>
#include<conio.h>
int main()
{
// clrscr();
//////////////////////////////calculating factorial
for(int input = 1; input <= 20; input++)
{
double temp=1;
for(int i = 1; i <= input; i++)
{
temp = temp * i;
}
//////////////////////////////
cout<<"Factorial of "<<input<<" is: "<<temp<<endl;
}

return 0;
// getch();
}

http://www.ravianeducation.blogspot.com
FARHAN: 03008855006