I just bought a visual basic 6 book. This will be my very first language.
Im in ch 3 of he book and it gives an exercise and wants me to make a script to compare 3 random integers and make it print the smallest and largest of the 3.
X is the largest number of the 3.
y is the smallest of the 3.
is there some way i can compare 1 integer to a list?
this is what i had in mind....
If X>(y,z) then
X=largest
End If
If Y> (x,z) then
Y=largest
End If
If Z>(x,y) then
Z=largest
End If
If X<(y,z) then
X=smallest
End If
If Y< (x,z) then
Y=smallest
End If
If Z<(x,y) then
Z=smallest
End If
Print largest ,"is the largest of the 3 numbers."
Print smallest, " is the smallest of the 3 numbers."
Im aware that my print statement may be out of wack but I'd like to concentrate on the comparisons.
Thank you
Im in ch 3 of he book and it gives an exercise and wants me to make a script to compare 3 random integers and make it print the smallest and largest of the 3.
X is the largest number of the 3.
y is the smallest of the 3.
is there some way i can compare 1 integer to a list?
this is what i had in mind....
If X>(y,z) then
X=largest
End If
If Y> (x,z) then
Y=largest
End If
If Z>(x,y) then
Z=largest
End If
If X<(y,z) then
X=smallest
End If
If Y< (x,z) then
Y=smallest
End If
If Z<(x,y) then
Z=smallest
End If
Print largest ,"is the largest of the 3 numbers."
Print smallest, " is the smallest of the 3 numbers."
Im aware that my print statement may be out of wack but I'd like to concentrate on the comparisons.
Thank you