- What are nested loops and how to use them
- What is a function and how do you use functions
- What is the difference between a declarartion and a definition of a function
- What is a prototype
- Scope of variables
- What are the
gcc
flags-Wall -Werror -pendatic -Wextra -std=gnu89
- What are header files and how to use them with
#include
- Tests: Location of test files. Provided by Holberton School.
- _putchar.c: C function that writes a character to
stdout
.
- main.h: Header file containing prototypes for all functions written in project.
File | Prototype |
---|---|
1-alphabet.c | void print_alphabet(void) |
2-print_alphabet_x10.c | void print_alphabet_x10(void); |
3-islower.c | int _islower(int c); |
4-isalpha.c | int _isalpha(int c); |
5-sign.c | int print_sign(int n); |
6-abs.c | int _abs(int); |
7-print_last_digit.c | int print_last_digit(int); |
8-24_hours.c | void jack_bauer(void); |
9-times_table.c | void times_table(void) |
10-add.c | int add(int, int); |
11-print_to_98.c | void print_to_98(int n); |
100-times_table.c | void print_times_table(int n) |
-
_0. putchar
- 0-putchar.c: C program that prints
_putchar
, followed bby a new line.- The program should return
0
- The program should return
- 0-putchar.c: C program that prints
-
1. I sometimes suffer from insomnia. And when I can't fall asleep, I play what I call the alphabet game
- 1-alphabet.c: C program that prints the alphabet in lowercase, followed by a new line
- Prototype:
coid print_alphabet(void);
- You can only use _putchar twice in our code
- Prototype:
- 1-alphabet.c: C program that prints the alphabet in lowercase, followed by a new line
-
2. 10 x alphabet
- 2-print_alphabet_x10.c: C program that prints 10 times the alphabet, in lowercase, followed by a new line.
- Prototype:
void print_alphabet_x10(void);
- You can only use
_putchar
twice in your code
- Prototype:
- 2-print_alphabet_x10.c: C program that prints 10 times the alphabet, in lowercase, followed by a new line.
-
3. islower
- 3-islower.c: C program that checks for lowercase character.
- Prototype:
int _islower(int c);
- Returns
1
ifc
is lowercase - Returns
0
otherwise.
- Prototype:
- 3-islower.c: C program that checks for lowercase character.
-
4. isalpha
- 4-isalpha.c: C program that checks for alphabetic character.
- Prototype:
int _islpha(int c);
- Returns
1
ifc
is a letter, lowercase or uppercase - Returns
0
otherwise
- Prototype:
- 4-isalpha.c: C program that checks for alphabetic character.
-
5. Sign
- 5-sign.c: C program that prints the sign of number
- Prototype:
int print_sign(int n);
- Returns
1
and prints+
ifn
is greater than zero - Returns
0
and prints0
ifn
is zero - Returns
-1
and prints-
ifn
is less than zero
- Prototype:
- 5-sign.c: C program that prints the sign of number
-
6. There is no such thing as absolute value in this world. You can only estimate what a thing is worth to you
- 6-abs.c: C program that computes the absolute value of an integer
- Prototype:
int _abs(int);
- Prototype:
- 6-abs.c: C program that computes the absolute value of an integer
-
7. There are only 3 colors, 10 digits, and 7 notes; it's what we do with them that's important
- 7-print_last_digit.c: C program prints the last digit of a number.
- Prototype:
int print_last_digit(int);
- Returns the value of the last digit
- Prototype:
- 7-print_last_digit.c: C program prints the last digit of a number.
-
8. I'm federal agent Jack Bauer, and today is the longest day of my life
- 8-24_hours.c: C program that prints every minute of the day of Jack Bauer, starting from 00:00 to 23:59.
- Prototype:
void jack_bauer(void);
- You can listen this soundtrack while coding :)
- Prototype:
- 8-24_hours.c: C program that prints every minute of the day of Jack Bauer, starting from 00:00 to 23:59.
-
9. Learn your times table
- 9-times_table.c: C program that prints the 9 times table, starting with 0.
- Prototype:
void times_table(void);
- Prototype:
- 9-times_table.c: C program that prints the 9 times table, starting with 0.
-
10. a + b
- 10-add.c: C program that adds two integers and returns the result
- Prototype:
int add(int, int);
- 10-add.c: C program that adds two integers and returns the result
- Prototype:
-
11. 98 Battery Street, the OG
- 11-print_to_98.c: C program that prints all natural numbers from
n
to98
, followed by a new line.- Prototype:
void print_to_98(int n);
- Numbers must be separated by a comma, followed by a space
- Numbers should be printed in order
- The first printed number should be the number passed to your function.
- The last printed number should 98
- You are allowed to use the standard library
- Prototype:
- 11-print_to_98.c: C program that prints all natural numbers from
-
12. The World looks like a multiplication-table, or a mathematical equation, which, turn it how you will, balances itself
- 100-times_table.c: C program that prints the
n
times table, starting with 0.- Prototype:
void print_times_table(int n);
- If
n
is greater than15
or less than0
the function should not print anything
- Prototype:
- 100-times_table.c: C program that prints the
-
13. Nature made the natural numbers; All else is the work of women
- 101-natural.c: C program that computes and prints the sum of all the multiples of
3
or5
below1024
(excluded), followed by a new line.- You are allowed to use the standard library
- 101-natural.c: C program that computes and prints the sum of all the multiples of
-
14. In computer class, the first assignment was to write a program to print the first 100 Fibonacci numbers. Instead, I wrote a program that would steal passwords of students. My teacher gave me an A
- 102-fibonacci.c: C program that prints the first 50 Fibonnaci numbers, strting with
1
and2
, followed by a new line.- The numbers must be separated by comma, followed by a space
,
- You are allowed to use the standard library
- The numbers must be separated by comma, followed by a space
- 102-fibonacci.c: C program that prints the first 50 Fibonnaci numbers, strting with
-
15. Even Liber Abbaci
- 103-fibonacci.c: C program that prints the sum of even-valued terms less than 4,000,000 as in the Fibonnaci sequence, followed by a new line.
-
16. In computer class, the first assignment was to write a program to print the first 100 Fibonacci numbers. Instead, I wrote a program that would steal passwords of students. My teacher gave me an A+
- 104-fibonacci.c: C program that finds and prints the first 98 Fibonnaci numbers, starting with
1
and2
, followed by a new line.- The numbers should be separated by comma, followed by a space
,
- You are allowed to use the standard library
- You are not allowed to use any other library (You can’t use
GMP
etc…) - You are not allowed to use
long long
,malloc
, pointers, arrays/tables, or structures - You are not allowed to hard code any Fibonacci number (except for
1
and2
)
- The numbers should be separated by comma, followed by a space
- 104-fibonacci.c: C program that finds and prints the first 98 Fibonnaci numbers, starting with