|
1 | | -# Directory Name |
| 1 | +# ALX Low-Level Programming - 0x01. C - Variables, if, else, while |
2 | 2 |
|
3 | | -0x01-variable_if_else_while |
4 | 3 |
|
5 | | -# Directory Description |
| 4 | +## Table of Contents |
| 5 | + |
| 6 | +- [Exercise 0: Positive Anything Is Better Than Negative Nothing](#exercise-0-positive-anything-is-better-than-negative-nothing) |
| 7 | +- [Exercise 1: The Last Digit](#exercise-1-the-last-digit) |
| 8 | +- [Exercise 2: I Sometimes Suffer From Insomnia](#exercise-2-i-sometimes-suffer-from-insomnia) |
| 9 | +- [Exercise 3: alphABET](#exercise-3-alphabet) |
| 10 | +- [Exercise 4: When I Was Having That Alphabet Soup](#exercise-4-when-i-was-having-that-alphabet-soup) |
| 11 | +- [Exercise 5: Numbers](#exercise-5-numbers) |
| 12 | +- [Exercise 6: Numberz](#exercise-6-numberz) |
| 13 | +- [Exercise 7: Smile in the Mirror](#exercise-7-smile-in-the-mirror) |
| 14 | +- [Exercise 8: Hexadecimal](#exercise-8-hexadecimal) |
| 15 | +- [Exercise 9: Patience, Persistence and Perspiration](#exercise-9-patience-persistence-and-perspiration) |
| 16 | +- [Exercise 10: Inventing Is a Combination of Brains](#exercise-10-inventing-is-a-combination-of-brains) |
| 17 | +- [Exercise 11: The Success Combination in Business](#exercise-11-the-success-combination-in-business) |
| 18 | +- [Exercise 12: Software Is Eating the World](#exercise-12-software-is-eating-the-world) |
| 19 | + |
| 20 | +## Exercise 0: Positive Anything Is Better Than Negative Nothing |
| 21 | + |
| 22 | +**Objective:** This program assigns a random number to the variable `n` each time it's executed. The task is to complete the source code to print whether the number stored in `n` is positive or negative. |
| 23 | + |
| 24 | +**Explanation:** The program uses a random number generator to assign a value to the variable `n`. The completed source code should print whether `n` is positive, zero, or negative. |
| 25 | + |
| 26 | +... |
| 27 | + |
| 28 | +## Exercise 1: The Last Digit |
| 29 | + |
| 30 | +**Objective:** This program assigns a random number to the variable `n` each time it's executed. The task is to complete the source code to print the last digit of the number stored in `n`. |
| 31 | + |
| 32 | +**Explanation:** The program uses a random number generator to assign a value to the variable `n`. The completed source code should print the last digit of `n` and classify it as greater than 5, equal to 0, or less than 6 and not 0. |
| 33 | + |
| 34 | +... |
| 35 | + |
| 36 | +## Exercise 2: I Sometimes Suffer From Insomnia |
| 37 | + |
| 38 | +**Objective:** Write a program that prints the alphabet in lowercase, followed by a new line. |
| 39 | + |
| 40 | +**Explanation:** This program uses the `putchar` function to print each character of the lowercase alphabet. It iterates through the alphabet characters and prints them one by one using the `putchar` function. |
| 41 | + |
| 42 | +... |
| 43 | + |
| 44 | +## Exercise 3: alphABET |
| 45 | + |
| 46 | +**Objective:** Write a program that prints the alphabet in lowercase, followed by the alphabet in uppercase, each followed by a new line. |
| 47 | + |
| 48 | +**Explanation:** Similar to the previous exercise, this program uses the `putchar` function to print characters. It iterates through the lowercase alphabet and then the uppercase alphabet, printing each character using `putchar`. |
| 49 | + |
| 50 | +... |
| 51 | + |
| 52 | +## Exercise 4: When I Was Having That Alphabet Soup |
| 53 | + |
| 54 | +**Objective:** Write a program that prints the alphabet in lowercase, followed by a new line, while omitting the letters 'q' and 'e'. |
| 55 | + |
| 56 | +**Explanation:** This program iterates through the lowercase alphabet and prints each character using the `putchar` function, excluding the letters 'q' and 'e'. |
| 57 | + |
| 58 | +... |
| 59 | + |
| 60 | +## Exercise 5: Numbers |
| 61 | + |
| 62 | +**Objective:** Write a program that prints all single-digit numbers of base 10 starting from 0, followed by a new line. |
| 63 | + |
| 64 | +**Explanation:** This program uses a loop to iterate through the numbers 0 to 9 and prints each number using the `putchar` function. |
| 65 | + |
| 66 | +... |
| 67 | + |
| 68 | +## Exercise 6: Numberz |
| 69 | + |
| 70 | +**Objective:** Write a program that prints all single-digit numbers of base 10 starting from 0, followed by a new line. |
| 71 | + |
| 72 | +**Explanation:** Similar to the previous exercise, this program uses a loop to iterate through the numbers 0 to 9 and prints each number using the `putchar` function. |
| 73 | + |
| 74 | +... |
| 75 | + |
| 76 | +## Exercise 7: Smile in the Mirror |
| 77 | + |
| 78 | +**Objective:** Write a program that prints the lowercase alphabet in reverse, followed by a new line. |
| 79 | + |
| 80 | +**Explanation:** This program uses a loop to iterate through the lowercase alphabet characters in reverse order and prints each character using the `putchar` function. |
| 81 | + |
| 82 | +... |
| 83 | + |
| 84 | +## Exercise 8: Hexadecimal |
| 85 | + |
| 86 | +**Objective:** Write a program that prints all the numbers of base 16 in lowercase, followed by a new line. |
| 87 | + |
| 88 | +**Explanation:** This program uses a loop to iterate through the hexadecimal digits (0 to 15) and prints each digit as a character using the `putchar` function. |
| 89 | + |
| 90 | +... |
| 91 | + |
| 92 | +## Exercise 9: Patience, Persistence and Perspiration |
| 93 | + |
| 94 | +**Objective:** Write a program that prints all possible combinations of single-digit numbers, separated by a comma and space. |
| 95 | + |
| 96 | +**Explanation:** This program uses nested loops to generate and print all possible combinations of single-digit numbers separated by a comma and space. |
| 97 | + |
| 98 | +... |
| 99 | + |
| 100 | +## Exercise 10: Inventing Is a Combination of Brains |
| 101 | + |
| 102 | +**Objective (Advanced):** Write a program that prints all possible different combinations of two digits. |
| 103 | + |
| 104 | +**Explanation:** This program uses nested loops to generate and print all possible different combinations of two digits, while ensuring that each combination is unique. |
| 105 | + |
| 106 | +... |
| 107 | + |
| 108 | +## Exercise 11: The Success Combination in Business |
| 109 | + |
| 110 | +**Objective (Advanced):** Write a program that prints all possible different combinations of three digits. |
| 111 | + |
| 112 | +**Explanation:** This program uses nested loops to generate and print all possible different combinations of three digits, while ensuring that each combination is unique. |
| 113 | + |
| 114 | +... |
| 115 | + |
| 116 | +## Exercise 12: Software Is Eating the World |
| 117 | + |
| 118 | +**Objective (Advanced):** Write a program that prints all possible combinations of two two-digit numbers. |
| 119 | + |
| 120 | +**Explanation:** This program uses nested loops to generate and print all possible combinations of two two-digit numbers, while ensuring that each combination is unique. |
| 121 | + |
| 122 | +... |
| 123 | + |
| 124 | +Feel free to explore each exercise, understand the concepts, and modify the code as needed. Happy learning and coding! |
6 | 125 |
|
7 | | -# Directory Content |
|
0 commit comments