1 Replies - 802 Views - Last Post: 20 January 2013 - 08:05 PM Rate Topic: -----

#1 dlholtry  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 28-November 12

program to print only even numbers between 6 and 16 using events

Posted 20 January 2013 - 08:00 PM

I must use events in this program and it must print out even numbers. This is all I have. I am new to this and I have searched the internet for hours, I need help. Not sure if I am headed in the right direction and I know this looks bad. Thank you.



Module Modulel
Public Event PrintThis(ByVal Val As Integer)

Dim number as Integer = 6
While number <= 16
// PRINT Goes here ..
number = number + 2
End While

Is This A Good Question/Topic? 0
  • +

Replies To: program to print only even numbers between 6 and 16 using events

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9197
  • View blog
  • Posts: 34,551
  • Joined: 12-June 08

Re: program to print only even numbers between 6 and 16 using events

Posted 20 January 2013 - 08:05 PM

Searched for hours.. for what? You can quickly determine odd or even by using the modulus (or 'mod') and 2... so that would be a solid 'if' condition... and inside the condition you would have your print.. to console.. or 'write line' to the console.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1