I want to exit from a loop when both i and j have the value 6, but it exits when one of them has the value 6.
int i,j,k;
i=k=0;
j=1;
Random num = new Random();
Console.WriteLine("Please Press any Key to Roll");
while((i!=6)&&(j!=6))
{
Console.ReadKey();
i= num.Next(0,7);
j= num.Next(0,7);
Console.WriteLine("1st Rolled Number is: "+ i);
Console.WriteLine("2st Rolled Number is: "+ j);
k++;
}
Console.WriteLine("Your have achieved it in "+ k + " Atempts");