Академический Документы
Профессиональный Документы
Культура Документы
#include <conio>
funfactorial(int x)
{
return(x*funfactorial(x-1));
}
void main()
{
int vfactorial,vresultado;
do
{
gotoxy(30,4);cout<<"******FACTORIAL DE NUMEROS ENTRE 2 Y 8
";
gotoxy(25,7);cout<<"Ingrese el valor a Calcular: ";
cin>>vfactorial;
if (vfactorial<=1 || vfactorial>=9)
{
gotoxy(30,20);cout<<"ERROR NUMERO INVALIDO";
getch();
clrscr();
}
{
vresultado=funfactorial(vfactorial);
gotoxy(25,7);cout<<"El factorial de "<<vfactorial<<" es:
"<<vresultado;
getch();
}
}while(vfactorial<=1 || vfactorial>=9);
}