I'm trying to make a program to calculate the factorial of the number given. But if the user enters a number which is less or equal to 0, I want the program to want it till he enter a number which is more than 0.

```
#include <iostream>
using namespace std;
void facto(int a){
    int faktoriyel = 1;
    for(int i=1;i<=a;i++){
        faktoriyel *=i;
}
    cout << "The result:" << faktoriyel << endl;
}
int main(){
    int a;
    cout<<"Please enter a valid number:"; cin >> a;
    if(a<=0){
        cout<<"You entered an invalid number. Please try again.";
}
    while(a<=0);
    facto(a);
    return 0;

}

```

When I enter an invalid number, the program asks me to try again but i can't input any numbers. So my questions are:

a)How can I do it?

b)Is there anything unclear in my code?

c)What if I wanted the program to give me the results of the numbers I've entered, until I pressed enter button? How can I do it? (Like, I want it to give me the result of 3 4 and 5 in the order of 6 24 120 and then I press enter to end the program)