#include <unistd.h>
void ft_print_comb2(void)
{
int nb1;
int nb2;
char nb1_str[3];
char nb2_str[3];
nb1 = 0;
while (nb1 <= 98)
{
nb2 = nb1 + 1;
while (nb2 <= 99)
{
if (nb1 < nb2)
{
nb1_str[0] = (nb1 / 10) + '0';
nb1_str[1] = (nb1 % 10) + '0';
nb1_str[2] = 0; // Null-terminator for the string, not strictly needed here as we're writing only 2 chars
nb2_str[0] = (nb2 / 10) + '0';
nb2_str[1] = (nb2 % 10) + '0';
nb2_str[2] = 0; // Null-terminator for the string, not strictly needed here as we're writing only 2 chars
write(1, nb1_str, 2);
write(1, " ", 1);
write(1, nb2_str, 2);
if (nb1 != 98)
write(1, ", ", 2);
}
nb2++;
}
nb1++;
}
}
int main(void)
{
ft_print_comb2();
return (0);
}
To embed this project on your website, copy the following code and paste it into your website's HTML: