469,270 Members | 1,260 Online

# calculate consecutive int values to the sum of inputed number 1
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"

Feb 5 '07 #1
2 1724 Ganon11
3,652 Expert 2GB
What have you done so far? How do you think you'll solve this problem?
Feb 5 '07 #2
Manjiri
40 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"

 2 posts views Thread by Phil Powell | last post: by 11 posts views Thread by David | last post: by 1 post views Thread by Building Blocks | last post: by 53 posts views Thread by Cardman | last post: by 2 posts views Thread by Hugo L. | last post: by 6 posts views Thread by Herrcho | last post: by 11 posts views Thread by xctide | last post: by 7 posts views Thread by Sharkie | last post: by 8 posts views Thread by gigonomics | last post: by reply views Thread by ioana budai | last post: by reply views Thread by zhoujie | last post: by reply views Thread by SioSio | last post: by 1 post views Thread by SwissProgrammer | last post: by 2 posts views Thread by SwissProgrammer | last post: by 1 post views Thread by cyogarajmsc | last post: by reply views Thread by sanil123 | last post: by 1 post views Thread by junedadenwalla | last post: by reply views Thread by sergioITA | last post: by