shiccorama
Member
- Joined
- Apr 24, 2021
- Messages
- 6
- Programming Experience
- 1-3
Dear all, how are you ?
this is sherif and I'm a newbie in learning c#, would you please help me ?
my function is this :
and the output is // The Largest Number is : 0
why "zero", what's wrong ????
thanks in advance ....
this is sherif and I'm a newbie in learning c#, would you please help me ?
my function is this :
C#:
double FirstNum;
double SecondNum;
double ThatsMyNum;
public void LargestOfThree(double x, double y, double z)
{
if (x > y)
{
x = FirstNum;
}
else if (z > y)
{
z = SecondNum;
}
else if (FirstNum > SecondNum)
{
ThatsMyNum = FirstNum;
}
else
{
ThatsMyNum = SecondNum;
}
Console.WriteLine("The Largest Number is : " + ThatsMyNum);
}
why "zero", what's wrong ????
thanks in advance ....
Last edited by a moderator: