This program works fine only for a number containing three digits.
But i prefer to intake these three digits at the time of scanning as a string rather than a single number for the flexibility of the program.
#include<string.h>
#include<stdio.h>
main()
{
char string_of_integers[4];
char first 0;
char second 0;
char third 0;
printf("nGive any three digit number");
scanf("n s" string_of_integers);
printf("nThe required combinations are:n")
for(first 0;first< 2;first++)
for(second 0;second< 2;second++)
for(third 0;third< 2;third++)
printf(" c c ct" string_of_integers[first] string_of_integers[second] string_of_integers[third]);
printf("nThis is the end of the program");
getch();
}
Expand the logic to make it work for more number of digits and also use some additional verificational logic if you are to work with varying number of digits i mean you need to add extra logic if at all flexibility needs to be a attribute of the program.