Using Visual Basic 2010
Question: Loop from -20 to 40. Display all the numbers that are multiples of 4. Also indicate which of these displayed numbers are the multiples of 6 and subtract the multiples of 6 from each other. Display the answer
My coding:
My problem: Im getting the multiple of 4 by "mod", so the answer will be "0". So I don't know how im I to get the multiples of 6 from the multiples of 4, is the another way to do this?
And my other problem is when using mod to get the multiples of 4, it shows 0 as a multiple of 4 which is wrong
thanks in advance
Question: Loop from -20 to 40. Display all the numbers that are multiples of 4. Also indicate which of these displayed numbers are the multiples of 6 and subtract the multiples of 6 from each other. Display the answer
My coding:
Code:
For intX = -20 To 40
If intX Mod 4 = 0 Then
lstDisplay.Items.Add(intX & " is a multiple of 4 (Four)")
End If
Next
lstDisplay.Items.Add("The answer is ")
And my other problem is when using mod to get the multiples of 4, it shows 0 as a multiple of 4 which is wrong
thanks in advance