calculate consecutive int values to the sum of inputed number

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Michael21622
    New Member
    • Feb 2007
    • 1

    calculate consecutive int values to the sum of inputed number

    pls help me to write a program such that we input an integer x,where x>0. For x, the program has to convert it into the sum of consecutive positive integers. for e.g. let x=10 output should be "10= 1+2+3+4" the total no. of consecutive positive integers in the sum expression should be maximal. for e.g. if x= 9 result should be 2+3+4 and not 4+5. If x=4 , the output should be "no answer"

    thanx in advance
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    What have you done so far? How do you think you'll solve this problem?

    Comment

    • Manjiri
      New Member
      • Nov 2006
      • 40

      #3
      Originally posted by Michael21622
      pls help me to write a program such that we input an integer x,where x>0. For x, the program has to convert it into the sum of consecutive positive integers. for e.g. let x=10 output should be "10= 1+2+3+4" the total no. of consecutive positive integers in the sum expression should be maximal. for e.g. if x= 9 result should be 2+3+4 and not 4+5. If x=4 , the output should be "no answer"

      thanx in advance

      This problem has already solved once...
      Just review the history...

      Comment

      Working...