Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,745 members, 7,820,572 topics. Date: Tuesday, 07 May 2024 at 05:22 PM

Pls Help Out ( Visual Basic ) - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Pls Help Out ( Visual Basic ) (693 Views)

Visual Basic 2008 Express Edition / Can I Call Myself A Good Programmer If I Only Know Visual Basic / Any Visual Basic (VB) Guru In The House? (2) (3) (4)

(1) (Reply)

Pls Help Out ( Visual Basic ) by Talk2bryant(m): 5:03pm On Nov 18, 2013
was given a quiz in class earlier today, the question goes thus :
create a simple program which will determine if any random number is even or odd?


i just started vb days ago and have been trying to use the if-else statement and have not been getting.... pls gurus in the house help a bro out
Re: Pls Help Out ( Visual Basic ) by jboy01(m): 6:38am On Nov 19, 2013
Talk2bryant: was given a quiz in class earlier today, the question goes thus :
create a simple program which will determine if any random number is even or odd?


i just started vb days ago and have been trying to use the if-else statement and have not been getting.... pls gurus in the house help a bro out

Here is my one cent.

Private sub randomTest()
Dim randomInt as integer
Dim rnd as new system.random()
randomInt = rnd.Next(0, 100) 'generate randon from 0 to 99
If(randomInt % 2 > 0) then
System.writeln(" The ganerated value is an odd number"wink

Else
System.writeln("the generated value is an even number"wink
End if
End sub

(1) (Reply)

Contact Me If You Know How To Use Cryengine3 / How To Create Your Own Dropbox App/Startup / Looking For A Drupal Developer

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 14
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.