#include<stdio.h>
#include<unistd.h>
void ft_putchar(char x){
write(1, &x, 1);
}
void ft_print_comb()
{
char i, j, k;
i = '0';
while(i <= 7){
i++;
j = i+1;
while(j <= 8){
j++;
k = j+1;
while(k <= 9){
k++;
ft_putchar(i);
ft_putchar(j);
ft_putchar(k);
ft_putchar(',');
ft_putchar(' ');
}
}
}
}
int main(){
ft_print_comb();
return 0;
}
I have tried to do couple changes but it either broke the code or kept giving me no output. What I am trying to do is create a function that displays all different combinations of three different digits in ascending order, listed by ascending order. for loop and printf functions are not allowed.