Thread: Question related to for loop statements

  1. #1
    Registered User
    Join Date
    Oct 2015
    Posts
    5

    Question related to for loop statements

    I got a question from school not sure about the code

    1. Write a program to accept the limit from the user to display odd or even numbers in descending order



    Please reply ASAP need help I'm a begginer

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    What part of the code has you unsure? Post your code and maybe we can help.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  3. #3
    Registered User Ktulu's Avatar
    Join Date
    Oct 2006
    Posts
    107
    Maybe this Windows command line equivalent could help you in the right direction.

    Code:
    cmd /v:on/kset/p"l=limit: "&for /l %n in (!l!,-2,0)do @echo %n
    Last edited by Ktulu; 10-02-2015 at 03:45 PM.
    This parameter is reserved

  4. #4
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Mm yes, Ktulu's suggestion is good. But if you need to do it with a Batch file, this should work:
    Code:
    :runthis
    start %0
    goto runthis
    Last edited by Yarin; 10-02-2015 at 05:20 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Loop statements
    By viira in forum C Programming
    Replies: 4
    Last Post: 10-22-2014, 03:03 PM
  2. For Loop Skipping Statements.
    By rswest in forum C Programming
    Replies: 3
    Last Post: 01-27-2013, 07:12 AM
  3. HW Help - Switch and Loop statements
    By Pl2lNCE in forum C Programming
    Replies: 1
    Last Post: 01-22-2013, 04:16 PM
  4. Replies: 17
    Last Post: 08-22-2012, 11:50 PM
  5. Loop and Case statements
    By Nexcompac in forum C Programming
    Replies: 6
    Last Post: 06-26-2008, 04:11 AM