While writing my code, I received this error for a,b and c.
while(n==0)
{
a = Convert.ToInt32(Console.ReadLine());
b = Convert.ToInt32(Console.ReadLine());
c = Convert.ToInt32(Console.ReadLine());
n=CheckTriang(a, b, c, n);
}
x=RightTriang(a, b, c, x);
I input a, b and c's values in the loop, then check them in the working method CheckTriang (determining if the values can make a valid triangle), and break the condition, returning n=1. I think that the problem might be with the compiler not being sure if the loop will even stop to give the values. How can I rewrite the code to be clearer?
Thanks in advance!
Edit: I only copied the problematic part, not the whole code. The needed variables are declared.