i want to pick the integer combinations using a single integer,
like I have a number 1234.. Now what i want is: 1,2,3,4,12,23,34,123,234,1234
Kindly help..??
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If I understood you right, you want all substrings of a given string (in this case the number 1234). So, for a string of length n there are n substrings of length 1, n − 1 substrings of length 2, etc. until one substring of length n.
Given that you can easily solve this with two nested loops, e.g.:
(Untested and there are likely fencepost errors, but you get the idea.)