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
This answer is:
User Avatar

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