Check which numbers satisfy the condition [A*B*C = A! + B! + C!] #include &lt;iostream&gt;
#include &lt;cmath&gt;
using namespace std;
int s = 1; //Serial No.


Should I use recursion for the factorials function?

int Factorial(int n)
{
    int k=1;
    for(int i=1;i&lt;=n;++i)
    {
        k=k*i;
    }
    return k;
}


How I can go about doing this in a single for loop instead of the 3 while loops?

int main()
{
    int a = 1;
    int b = 1;
    int c = 1;
    int Fact1;
    int Fact2;
    int Fact3;
    while (a &lt; 11)
    {
        Fact1 = Factorial(a);
        while (b &lt; 11)
        {
            Fact2 = Factorial(b);
            while (c &lt; 11)
            {
                Fact3 = Factorial(c);
                cout &lt;&lt; s &lt;&lt; " : ";
                int LHS = Fact1 + Fact2 + Fact3;
                if (LHS == a * b * c)
                {
                    cout &lt;&lt; "Pass:" &lt;&lt;"    "&lt;&lt; a &lt;&lt; " &amp; " &lt;&lt; b &lt;&lt; " &amp; " &lt;&lt; c &lt;&lt; endl;
                }
                else
                {
                    cout &lt;&lt; "Fail" /*&lt;&lt;"   "&lt;&lt; Fact1 &lt;&lt;"   "&lt;&lt; Fact2 &lt;&lt;"   "&lt;&lt;Fact3*/&lt;&lt;endl;
                }
                    c++;
                    s++;
            }
            c = 1;
            b++;
        }
        b = 1;
        a++;
    }
    return 0;
}


Also I would love some variable naming tips.
Hello and welcome to Code Review. 

Surprisingly, a, b, and c are probably the best variable names you can come up with. They are conventionally given as canonical examples of bad names, but when the task is to implement a mathematical function using the same variable names as in the spec is more important. 

As to the single loop question, the short answer is "not easily". You are trying to check all combinations of three independently varying things. That means you naturally want three loops, and anything else would lose out on readability.



Aside from your questions, I have a few observations about this code that might be worth fixing. 


When you have a loop that is counting up to something, it is convention to prefer a for loop to a while loop.
Factorial is what is known as a "pure function" which means that its output only depends on its input. Such functions within loops are often good candidates for caching so that you don't have to waste time calculating the same output a hundred and eleven times for each input number. 
Both + and * are commutative, which means that if a, b, and c pass then b, a, and c also pass. You should check whether you need to display all reorderings of the same sets of numbers.
It is unclear where 11 has come from. It seems like a magic number, which would benefit from being moved to a named constant and having a comment explaining why that value is used.