In this project, I learned about using arithmetic, logical, relational, and boolean
operators in C. Additionally, I practiced declaring and defining variables of type
char
, int
, and unsigned int
, using if
and if...else
statements, and
implementing while
loops.
-
0. Positive anything is better than negative nothing
- 0-positive_or_negative.c: C program that prints whether
a randomly generated number is positive or negative, followed by a new line:
- Completion of this source code.
- Stores a different random number every time the program is run.
- Prints the number followed by
is positive
if the number is greater than 0,is zero
if the number is zero, oris negative
if the number is less than 0.
- 0-positive_or_negative.c: C program that prints whether
a randomly generated number is positive or negative, followed by a new line:
-
1. The last digit
- 1-last_digit.c: C program that prints the last digit of a
randomly generated number, followed by a new line:
- Completion of this source code.
- Stores a different value every time the program is run.
- Prints the string
Last digit of
[number]is
[last_digit]and is
followed bygreater than 5
if the digit is greater than 5,0
if the digit is 0, orless than 6 and not 0
if the digit is less than 6 and not 0.
- 1-last_digit.c: C program that prints the last digit of a
randomly generated number, followed by a new line:
-
2. I sometimes suffer from insomnia. And when I can't fall asleep, I play what I call the alphabet game
- 2-print_alphabet.c: C program that prints the alphabet in
lowercase, followed by a new line, using only the
putchar
function exactly twice.
- 2-print_alphabet.c: C program that prints the alphabet in
lowercase, followed by a new line, using only the
-
3. When I was having that alphabet soup, I never thought that it would pay off
- 3-print_alphabets.c: C program that prints the alphabet in
lowercase, then in uppercase, followed by a new line, using only the
putchar
function exactly three times.
- 3-print_alphabets.c: C program that prints the alphabet in
lowercase, then in uppercase, followed by a new line, using only the
-
4. alphABET
- 4-print_alphabt.c: C program that prints the alphabet in lowercase
except for the letters
q
ande
, followed by a new line, using only theputchar
function exactly twice.
- 4-print_alphabt.c: C program that prints the alphabet in lowercase
except for the letters
-
5. Numbers
- 5-print_numbers.c: C program that prints all single digit numbers
of base 10 starting from
0
, followed by a new line.
- 5-print_numbers.c: C program that prints all single digit numbers
of base 10 starting from
-
6. Numberz
- 6-print_numberz.c: C program that prints all single digit numbers
of base 10 starting from
0
, followed by a new line, using only theputchar
function exactly twice without any variables of typechar
.
- 6-print_numberz.c: C program that prints all single digit numbers
of base 10 starting from
-
7. Smile in the mirror
- 7-print_tebahpla.c: C program that prints the lowercase alphabet
in reverse, followed by a new line, using only the
putchar
function exactly twice.
- 7-print_tebahpla.c: C program that prints the lowercase alphabet
in reverse, followed by a new line, using only the
-
8. Hexadecimal
- 8-print_base16.c: C program that prints all the numbers of base
16 in lowercase, followed by a new line, using only the
putchar
function exactly three times.
- 8-print_base16.c: C program that prints all the numbers of base
16 in lowercase, followed by a new line, using only the
-
9. Patience, persistence and perspiration make an unbeatable combination for success
- 9-print_comb.c: C program that prints all possible combinations of
single-digit numbers, using only the
putchar
function exactly four times without any variables of typechar
:- Numbers are separated by
,
, followed by a space. - Numbers are printed in ascending order.
- Numbers are separated by
- 9-print_comb.c: C program that prints all possible combinations of
single-digit numbers, using only the
-
10. 00...99
- 10-print_comb2.c: C program that prints the numbers from
00
to99
using only theputchar
function exactly five times without any variables of typechar
:- Numbers are separated by
,
, followed by a space. - Numbers are printed in ascending order, with two digits.
- Numbers are separated by
- 10-print_comb2.c: C program that prints the numbers from
-
11. Inventing is a combination of brains and materials. The more brains you use, the less material you need
- 100-print_comb3.c: C program that prints all possible different
combinations of two digits using only the
putchar
function exactly five times without any variables of typechar
:- Numbers are separated by
,
, followed by a space. - The two digits are different.
01
and10
are considered the same combination of the two digits0
and1
.- Prints only the smallest combination of two digits.
- Numbers are printed in ascending order.
- Numbers are separated by
- 100-print_comb3.c: C program that prints all possible different
combinations of two digits using only the
-
12. The success combination in business is: Do what you do better... and: do more of what you do...
- 101-print_comb4.c: C program that prints all possible different
combinations of three digits using only the
putchar
function exactly six times without any variables of typechar
:- Numbers are separated by
,
, followed by a space. - The three digits are different.
012
,120
,102
,021
,201
and210
are considered the same combination of the three digits0
,1
and2
.- Prints only the smallest combination of three digits.
- Numbers are printed in ascending order.
- Numbers are separated by
- 101-print_comb4.c: C program that prints all possible different
combinations of three digits using only the
-
13. Software is eating the World
- 102-print_comb5.c: C program that prints all possible combinations
of two-digit numbers using only the
putchar
function exactly eight times without any variables of typechar
:- Numbers range from
0
to99
. - Two numbers are separated by a space.
- Numbers are printed with two digits [ie.
1
is printed as01
]. 00 01
and01 00
are considered the same as the combination of of the numbers0
and1
.- Combinations of numbers are separated by
,
, followed by a space. - Combinations of numbers are printed in ascending order.
- Numbers range from
- 102-print_comb5.c: C program that prints all possible combinations
of two-digit numbers using only the