Can you tell me how to solve this problem please?

82 Views Asked by At

This program is about to determine the r Value which are following this statement:

int rV;
if ( (p-1) % rV == 0 && rV % ( (p-1) / rV ) == 1 && rV % (q-1) == 1 )
  tbKr.Text = rV.ToString();
rV = Convert.ToInt32(tbKr.Text);

And this is the error:

Use of unassigned local variable 'rV' (CS0165)

Thank you so much for your help.

1

There are 1 best solutions below

0
PVA On

In first "if" you use rv:

rV%((p-1)/rV)==1

but this variable has no value i.e. unassigned. You can't use variable before you set value.