//factorial program which takes integer n and prints its factorial
//and the operation repeats until n<=0
#include <iostream>
usingnamespace std;
int main()
{
int num,factorial=1;
while (1)
{
cin>>num;
if(num<=0)
return 0;
elsefor(int i=2;i<=num;i++)
{
factorial*=i;
}
cout<<factorial<<endl;
}
return 0;
}
The Problem is :Write a c++ Program which takes an integer number n and prints its factorial.You should repeat this operation until n<=0
and thank you for reply