NUMBER SERIES TO DISPLAY NUMBERS WITH RANGE

Posted by Macki under C# on 4/20/2013 | Points: 10 | Views : 753 | Status : [Member] | Replies : 1
HI
INPUT :NUMBER SERIES GIVEN BY USERS AS INPUT WITH COMMAS
example 1,2,3,4,7,9,10,34,35,

OUTPUT : TO DISPLAY NUMBERS WITH RANGE
example:1-4 7-9 10 34-35

REGARDS
macki.

Regards
Macki



Responses

Posted by: Niladri.Biswas on: 5/3/2013 [Member] Platinum | Points: 25

Up
0
Down
Could you explain the logic of forming the output? What is the pattern that prompts you to do so? If I understand you correctly, then the range should be of a continuous number.In that case the output will be

1-4 7 9-10 34-35

Best Regards,
Niladri Biswas

Macki, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response