This directory contains solutions to various tasks related to more functions and nested loops in the C programming language. Each task is represented by a separate C file with a specific function to complete. The tasks cover topics such as character manipulation, multiplication, printing numbers, drawing shapes, and more.
-
0-isupper.c: Uppercase Character 👆
- Description: Write a function to check for an uppercase character.
- Prototype:
int _isupper(int c) - Usage: The function can be called to check if a character is uppercase.
-
1-isdigit.c: Digit Checker 🔢
- Description: Write a function to check for a digit (0 through 9).
- Prototype:
int _isdigit(int c) - Usage: The function can be called to check if a character is a digit.
-
2-mul.c: Multiply Function ✖️
- Description: Write a function to multiply two integers.
- Prototype:
int mul(int a, int b) - Usage: The function can be called to multiply two integers.
-
3-print_numbers.c: Print Numbers 0 to 9 🔢
- Description: Write a function to print the numbers from 0 to 9, followed by a new line. You can only use the
_putcharfunction twice in your code. - Prototype:
void print_numbers(void) - Usage: The function can be called to print the numbers.
- Description: Write a function to print the numbers from 0 to 9, followed by a new line. You can only use the
-
4-print_most_numbers.c: Print Most Numbers 0 to 9 (Except 2 and 4) 🚫
- Description: Write a function to print the numbers from 0 to 9, except 2 and 4, followed by a new line. You can only use the
_putcharfunction twice in your code. - Prototype:
void print_most_numbers(void) - Usage: The function can be called to print the numbers.
- Description: Write a function to print the numbers from 0 to 9, except 2 and 4, followed by a new line. You can only use the
-
5-more_numbers.c: Print More Numbers 0 to 14 (Ten Times) 🔢
- Description: Write a function to print the numbers from 0 to 14, ten times, followed by a new line. You can only use the
_putcharfunction three times in your code. - Prototype:
void more_numbers(void) - Usage: The function can be called to print the numbers.
- Description: Write a function to print the numbers from 0 to 14, ten times, followed by a new line. You can only use the
-
6-print_line.c: Draw a Straight Line 📏
- Description: Write a function to draw a straight line in the terminal using the character
_. The line should end with a new line (\n). Ifnis 0 or less, the function should only print a new line. - Prototype:
void print_line(int n) - Usage: The function can be called to draw a line.
- Description: Write a function to draw a straight line in the terminal using the character
-
7-print_diagonal.c: Draw a Diagonal Line ➖
- Description: Write a function to draw a diagonal line in the terminal using the character
\. The diagonal should end with a new line (\n). Ifnis 0 or less, the function should only print a new line. - Prototype:
void print_diagonal(int n) - Usage: The function can be called to draw a diagonal line.
- Description: Write a function to draw a diagonal line in the terminal using the character
-
8-print_square.c: Print a Square ▢
- Description: Write a function to print a square in the terminal using the character
#. The square should be of sizesize. Ifsizeis 0 or less, the function should only print a new line. - Prototype:
void print_square(int size) - Usage: The function can be called to print a square.
- Description: Write a function to print a square in the terminal using the character
-
9-fizz_buzz.c: Fizz-Buzz Test 🍻
- Description: Write a program that prints the numbers from 1 to 100, followed by a new line. But for multiples of three, print "Fizz" instead of the number, and for multiples of five, print "Buzz". For numbers that are multiples of both three and five, print "FizzBuzz".
- Usage: The program can be executed to print the Fizz-Buzz test.
-
10-print_triangle.c: Print a Triangle ▲
- Description: Write a function to print a triangle in the terminal using the character
#. The triangle should have a size ofsize. Ifsizeis 0 or less, the function should only print a new line. - Prototype:
void print_triangle(int size) - Usage: The function can be called to print a triangle.
- Description: Write a function to print a triangle in the terminal using the character
-
100-prime_factor.c: Largest Prime Factor 🌟
- Description: Write a program that finds and prints the largest prime factor of the number 612852475143, followed by a new line.
- Usage: The program can be executed to find and print the largest prime factor.
-
101-print_number.c: Print an Integer 🔢
- Description: Write a function to print an integer using the
_putcharfunction. You are not allowed to uselong, arrays, or pointers. You are also not allowed to hard-code special values. - Prototype:
void print_number(int n) - Usage: The function can be called to print an integer.
- Description: Write a function to print an integer using the