Jump to content

Simple program to add odd numbers

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
nahrain

nahrain

    Newbie

  • Members
  • Pip
  • 5 posts
I need to write a simple program to add odd numbers. I need to get the user input for the upper bound. Can somebody please help me with the coding for this? I am new to Visual Basic, so an explanation in layman's terms would be very helpful. Thank you.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Based on your first sentence, I would expect the user to input two odd numbers, and you add them. Your second sentence suggests that you are doing something else, like adding all odd numbers up to a certain value? Can you give an example of what is supposed to be done?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
nahrain

nahrain

    Newbie

  • Members
  • Pip
  • 5 posts
WingedPanther,

Thank you for your responses, funny by the way! Ok, so, the user is supposed to enter a number in a textbox, and when they hit a button named "calculate", or whatever, the code is supposed to display, in a label, the Fibonacci Sequence up until that number ( I think that is the upper bound). So the coding will go in the button click event. Sorry if this seems to elementary for you, but I really am new.

#4
Corky

Corky

    Learning Programmer

  • Members
  • PipPipPip
  • 35 posts
? i think you meant to post this in your other topic ?

#5
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
I thought you wanted to add odd numbers... ?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog