Like Tree1Likes
  • 1 Post By Salem

Find all Even Numbers between two integers

This is a discussion on Find all Even Numbers between two integers within the C Programming forums, part of the General Programming Boards category; Hey everyone. Can anyone help me with this problem? Thank you!! Write a complete program which includes a function named ...

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    3

    Question Find all Even Numbers between two integers

    Hey everyone. Can anyone help me with this problem? Thank you!!


    Write a complete program which includes a function named print_even. The function is passed two integer numbers, start and stop, and returns nothing. The function prints all of the even numbers between start and stop . You can assume that start is less than or equal
    to stop . Your main function will ask the user to enter start and stop, and call the function.

    Example: print_even(1, 10) prints 2, 4, 6, 8, and 10.
    Last edited by Parker Abdo; 04-19-2012 at 11:02 PM. Reason: bad title

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,852
    Uppercase check with 2 functions
    I think you're just dumping your assignments without any thought or effort.

    > Your main function will ask the user to enter start and stop, and call the function.
    Can you do this?

    Can you even do "hello world"?

    Show some effort!
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,308
    You will not get any help here without showing that you have put in a lot of effort yourself.

    And I'm sorry, but this is almost the simplest possible programming assignment there is; You shouldn't even be turning to the net for help yet, as you haven't even started learning yet really.
    I mean if you were instead learning how to use a computer, you'd have rung up tech support the moment the box arrived, before even unpacking it.
    Last edited by iMalc; 04-20-2012 at 02:58 AM.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  4. #4
    Registered User
    Join Date
    Apr 2012
    Posts
    3
    Quote Originally Posted by iMalc View Post
    You will not get any help here without showing that you have put in a lot of effort yourself.

    And I'm sorry, but this is almost the simplest possible programming assignment there is; You shouldn't even be turning to the net for help yet, as you haven't even started learning yet really.
    I mean if you were instead learning how to use a computer, you'd have rung up tech support the moment the box arrived, before even unpacking it.
    Gee sorry for needing help the night before finals. I've spent 4 hours on these two problems that aren't even worth anything to me. Don't sit on your geeky ass and tell me I'm not putting in effort. I could show you my codes if that helped, but they are utterly terrible.

  5. #5
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,308
    I didn't say you weren't putting in any effort, I said that you weren't showing that you'd put in effort.
    In other words, post the code. That's how you show that you've put in effort.

    "night before finals"? Don't go laying a BS guilt trip on me. I'm not falling for that.

    What do you mean "two problems?" What's the other one?
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,852
    > I've spent 4 hours on these two problems that aren't even worth anything to me.
    But you cared enough to sign up to a forum, make 2 posts and put "Thanks" into both of them.

    > I could show you my codes if that helped, but they are utterly terrible.
    That's for us to judge - not you.

    Posting your code tells us all sorts of information
    - it shows you're making an effort (which is good for getting us to pay any attention to you)

    - it shows what you're doing right, as well as what you're doing wrong.
    This allows us to focus our short and valuable time (we're all free volunteers, not paid 24/7 you can just demand service from) on the things which need to be fixed.

    Now, post your code!
    phantomotap likes this.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  7. #7
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    4,415
    Saying that you've tried stuff doesn't really say much; we don't actually know what you've really done.

    We also had rather err on the side of you failing than get a good grade when you don't deserve it.

    Soma

  8. #8
    Registered User
    Join Date
    Apr 2012
    Posts
    44
    try working out with the remainder of each integer when divided by 2. See if these integers between your specified numbers are actually wholly divisible by 2.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 03-26-2012, 11:50 AM
  2. Replies: 47
    Last Post: 11-16-2009, 10:18 PM
  3. Vowels
    By BJtoVisualcC++ in forum C++ Programming
    Replies: 2
    Last Post: 06-09-2007, 10:51 PM
  4. find the totals of positive and negative integers
    By noaksey in forum C Programming
    Replies: 5
    Last Post: 05-11-2004, 02:59 PM
  5. Why can't my link list find integers 7 and 8??
    By LinkedListQ3 in forum C++ Programming
    Replies: 1
    Last Post: 01-07-2003, 01:11 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21