Hello everyone,
How can I solve this problem "not all code paths return a value"
For me all code paths return a value...
If b =< 0 then return res
else if b > 0 do the loop then return res
How can I solve this problem "not all code paths return a value"
static int Multiplication(int a, int B)/>
{
int res = 0;
while (b > 0)
{
res += a;
b = b - 1;
}
Console.WriteLine(res);
}
For me all code paths return a value...
If b =< 0 then return res
else if b > 0 do the loop then return res