answersLogoWhite

0


Best Answer
  1. dim x as integer
  2. dim y as integer
  3. dim z as integer
  4. on error goto Errorhandler
  5. user input "Type first integer"
  6. x = user input
  7. user input "Type second integer"
  8. y = user input
  9. user input "Type third integer"
  10. z = user input
  11. if z = 2+x and if y = 1+x then
  12. print "These numbers are consecutive!"
  13. print "Their product is" x*y*z
  14. elseif z <> 2+x or if y <> 1+x then
  15. print "These numbers are not consecutive."
  16. endif
  17. goto quit
  18. Errorhandler: Print error code
  19. quit

This is about as stripped down a program as you can write. Depending on the scripting language, you will have to re-write the syntax to comply with that language's rules for syntax and commands.

User Avatar

Wiki User

12y ago

Still curious? Ask our experts.

Chat with our AI personalities

JordanJordan
Looking for a career mentor? I've seen my fair share of shake-ups.
Chat with Jordan
ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi
RossRoss
Every question is just a happy little opportunity.
Chat with Ross

Add your answer:

Earn +20 pts
Q: Program to find product of three consecutive numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp