8-print_base16.c
#include <stdio.h>
/**
* main - Prints all the numbers of base 16 in lowercase.
*
* Return: Always 0.
*/
int main(void)
{
int num;
char letter;
for (num = 0; num < 10; num++)
putchar((num % 10) + '0');
for (letter = 'a'; letter <= 'f'; letter++)
putchar(letter);
putchar('\n');
return (0);
}
9-print_comb.c
#include <stdio.h>
/**
* main - Prints all possible combinations of single-digit numbers.
*
* Return: Always 0.
*/
int main(void)
{
int num;
for (num = 0; num <= 9; num++)
{
putchar((num % 10) + '0');
if (num == 9)
continue;
putchar(',');
putchar(' ');
}
putchar('\n');
return (0);
}
100-print_comb3.c
#include <stdio.h>
/**
* main - Prints all possible combinations of two different digits,
* in ascending order, separated by a comma followed by a space.
*
* Return: Always 0.
*/
int main(void)
{
int digit1, digit2;
for (digit1 = 0; digit1 < 9; digit1++)
{
for (digit2 = digit1 + 1; digit2 < 10; digit2++)
{
putchar((digit1 % 10) + '0');
putchar((digit2 % 10) + '0');
if (digit1 == 8 && digit2 == 9)
continue;
putchar(',');
putchar(' ');
}
}
putchar('\n');
return (0);
}
101-print_comb4.c
#include <stdio.h>
/**
* main - Prints all possible combinations of three different digits
* in ascending order, separated by a comma followed by a space.
*
* Return: Always 0.
*/
int main(void)
{
int digit1, digit2, digit3;
for (digit1 = 0; digit1 < 8; digit1++)
{
for (digit2 = digit1 + 1; digit2 < 9; digit2++)
{
for (digit3 = digit2 + 1; digit3 < 10; digit3++)
{
putchar((digit1 % 10) + '0');
putchar((digit2 % 10) + '0');
putchar((digit3 % 10) + '0');
if (digit1 == 7 && digit2 == 8 && digit3 == 9)
continue;
putchar(',');
putchar(' ');
}
}
}
putchar('\n');
return (0);
}
102-print_comb5.c
#include <stdio.h>
/**
* main - Prints all possible combinations of two two-digit numbers,
* ranging from 0-99, separated by a comma followed by a space.
*
* Return: Always 0.
*/
int main(void)
{
int num1, num2;
for (num1 = 0; num1 <= 98; num1++)
{
for (num2 = num1 + 1; num2 <= 99; num2++)
{
putchar((num1 / 10) + '0');
putchar((num1 % 10) + '0');
putchar(' ');
putchar((num2 / 10) + '0');
putchar((num2 % 10) + '0');
if (num1 == 98 && num2 == 99)
continue;
putchar(',');
putchar(' ');
}
}
putchar('\n');
return (0);
}
README.md
Create a readme.md file with
echo 'whatever you want to use to describe your work' > README.md
See part1: low_level_programming – 0x01-variables_if_else_while
Show some love by sharing.