locked
C# mod operator RRS feed

  • Question

  • There are four whole numbers below the number 14 that are multiples of either 4 or 7. They are: 4, 7, 8 and 12 The sum of these numbers is 31 Write a C# program to find all the multiples of either 4 or 7 between, and including, 100 and 120. Sum the found multiples and print the total out to the console. For bonus points, also print out how long your program took to execute.

    Please help im a coldfusion developer and not exactly sure about this...


    • Moved by Marvin_Guo Monday, February 24, 2014 10:04 AM
    Friday, February 14, 2014 12:28 PM

Answers

  • Hello,

    To being, these forums are not used to show code that is (and it appears your thread indicates this) for homework. With that said, post your code and ask us how we might assist you by leading you in the right direction.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

    • Proposed as answer by Ashish Pandey Friday, February 14, 2014 5:08 PM
    • Unproposed as answer by Ashish Pandey Friday, February 14, 2014 5:08 PM
    • Proposed as answer by Ashish Pandey Friday, February 14, 2014 5:08 PM
    • Marked as answer by Just Karl Friday, February 28, 2014 10:41 PM
    Friday, February 14, 2014 4:47 PM

All replies

  • Hello,

    To being, these forums are not used to show code that is (and it appears your thread indicates this) for homework. With that said, post your code and ask us how we might assist you by leading you in the right direction.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

    • Proposed as answer by Ashish Pandey Friday, February 14, 2014 5:08 PM
    • Unproposed as answer by Ashish Pandey Friday, February 14, 2014 5:08 PM
    • Proposed as answer by Ashish Pandey Friday, February 14, 2014 5:08 PM
    • Marked as answer by Just Karl Friday, February 28, 2014 10:41 PM
    Friday, February 14, 2014 4:47 PM
  • Hi,

    Firstly, like Kevin said,these forums are not used to show code that is for homework.

    Then, I think this issue you could traversal all of number, and find numbers which match to the condition.Please refer to the link below:

    #% Operator (C# Reference)

    http://msdn.microsoft.com/en-us/library/0w4e0fzs.aspx

    In addition, I think this issue is more related to C# forum ,Since this forum is discuss about Windows Forms Data Controls and Databinding .

    @Cor ,Thank you for pointing out my mistake :).

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Edited by Marvin_Guo Monday, February 24, 2014 10:04 AM
    Monday, February 24, 2014 1:24 AM