C program to find all combinations of 4 digit number

C program to find all combinations of 4 digit number

Output:

Enter a 4 digit number to find all its combinations:
1234
All combinations of number '1234' are:
1234
234
34
124
14
4
123
23
13
3
12
2
1

Implementation: