please give me your solution. i have tried to find the optimized answer on google but i dint find any optimized code.
Q:find sum of prime factors of given number. for example if n=18 answer would be 2+3=5

below is my code:

``````class Program
{
static void Main(string[] args)
{
Program p = new Program();
Console.WriteLine(&quot;Please provide Number : &quot;);
int sumRet = p.Prime_Fact(num);
Console.WriteLine(&quot;Desired Result :{0} &quot;,sumRet);

}

public int Prime_Fact(int n)
{
int originalNum=n;
int sum=0;
int primeLoop = 2;
int check;
g1: if (primeLoop &lt; originalNum/2)
{
if (n % primeLoop == 0)
{
sum = sum + primeLoop;
n = n / primeLoop;
}
g2: primeLoop++;
if ((check = Prime_Fact(primeLoop)) == 0)
{
goto g1;
}
else
{
goto g2;
}
}

return sum;
}
}``````

i need to optimize it. it is not passing some test cases also. test cases are not given to me. Please give me your suggetions.

If this is supposed to be C# it will not compile.
For a starter change &quot; in " and &lt; in <