i am trying to find out the minimum difference between three integers. And it says:"Operator '&&' can't be applied to operands of type 'int' and 'bool'". Where i am wrong?
static void Main(string[] args)
{
int number1, number2;
Console.WriteLine("Enter three numbers.");
int x= int.Parse(Console.ReadLine());
int y= int.Parse(Console.ReadLine());
int z= int.Parse(Console.ReadLine());
if(Math.Abs(x-y) < Math.Abs(y-z) && Math.Abs(x-z))
{
number= x;
number= y;
}
else if....
Aucun commentaire:
Enregistrer un commentaire