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.

Re: From Psuedo code to Visual Basic 80 80

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

Re: From Psuedo code to Visual Basic 80 80

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

Re: From Psuedo code to Visual Basic 80 80

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

Thanks.

Re: From Psuedo code to Visual Basic 80 80

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

Re: From Psuedo code to Visual Basic 80 80

ha...3x, google is great searcher machine...:)

commented: :D jokes +1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.