Skip to content

Instantly share code, notes, and snippets.

@kmbenjel
Created August 25, 2022 09:47
Show Gist options
  • Save kmbenjel/dc316415c44ff1ce0681e951e3e5eae5 to your computer and use it in GitHub Desktop.
Save kmbenjel/dc316415c44ff1ce0681e951e3e5eae5 to your computer and use it in GitHub Desktop.
#include<unistd.h>
void ft_putchar(char c)
{
write(1, &c, 1);
}
void ft_print_comb2(void)
{
int a;
int b;
a = 0;
while (a <= 98)
{
b = 1;
while (b <= 99)
{
ft_putchar((a / 10) + '0');
ft_putchar((a % 10) + '0');
ft_putchar(' ');
ft_putchar((b / 10) + '0');
ft_putchar((b % 10) + '0');
if (!(a == 98 && b == 99))
{
ft_putchar(',');
ft_putchar(' ');
}
b++;
}
a++;
}
}
int main()
{
ft_print_comb2();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment