What is an odd and even number program in visual basic?

1 answer

Answer

1115530

2026-08-12 18:25

+ Follow

I don't now visual basic, but to determine whether or not a number is even or odd, divide it by two twice, and round once. If the rounded result is equal to the non-rounded result, then the original number is even:

input n

if (n/2.0) == int(n/2.0)

print "the number is even"

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.