0

Hey Guys,

I have started using Visual basic 6.0 but i'm running into a few troubles.

How can i write this psuedo code into visual basic:

BEGIN even and odd numbers
    PUT "Enter a number : "
    GET num
    even = 0
    odd = 0
    WHILE num <> -1
        IF (num MOD 2) = 0 THEN
            even = even +1
        ELSE
            odd = odd + 1
        END IF
        PUT "Enter a number : "
        GET num
    WEND
    PUT "The number of even numbers = ", even
    PUT "The number of odd numbers = ", odd
END even and odd numbers

Any help would be greatly apprecieated.

Thanks,

Jem.

3
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by Jx_Man
Featured Replies
0

1. remove the begin end part
2.use INPUT BOX instead of PUT
3.accept the value from inputbox instead of GET.

rest almost remains

0

declare even and odd as integer and value to accomodate input (get).
to insert (put) number you can use text box or inputbox.

0

Hey guys thanks for your help so far but how do i accomodate the input

Thanks.

0

Don't worry i did some googling and found it out thanks for your help.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.