You are on page 1of 1

#include "stdafx.

h"
#include "iostream"
#include "conio.h"
#include "string"
#include <math.h>
using namespace std ;
int _tmain(int argc, _TCHAR* argv[])
{
double x1,cont,res;
res=1;
cont=1;
cout<<" ingrese el valor : ";cin >> x1;
while (cont<=x1)
{ res=(res*cont);
cont++;
}
cout<<" El factorial de "<<x1<< " es : "<<res;
_getch();
}

You might also like