Exos
This commit is contained in:
18
ex0/ft_putchar.c
Normal file
18
ex0/ft_putchar.c
Normal file
@@ -0,0 +1,18 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_putchar.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/03/04 09:24:28 by lclerel- #+# #+# */
|
||||
/* Updated: 2026/03/04 09:49:43 by lclerel- ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void ft_putchar(char c)
|
||||
{
|
||||
write(1, &c, 1);
|
||||
}
|
||||
18
ex1/ft_print_alphabet.c
Normal file
18
ex1/ft_print_alphabet.c
Normal file
@@ -0,0 +1,18 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_print_alphabet.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/03/04 09:53:03 by lclerel- #+# #+# */
|
||||
/* Updated: 2026/03/04 10:34:25 by lclerel- ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void ft_print_alphabet(void)
|
||||
{
|
||||
write(1, "abcdefghijklmnopqrstuvwxyz\n", 26);
|
||||
}
|
||||
18
ex2/ft_print_reverse_alphabet.c
Normal file
18
ex2/ft_print_reverse_alphabet.c
Normal file
@@ -0,0 +1,18 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_print_alphabet_reverse.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/03/04 10:01:47 by lclerel- #+# #+# */
|
||||
/* Updated: 2026/03/04 10:05:12 by lclerel- ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void ft_print_reverse_alphabet(void)
|
||||
{
|
||||
write(1, "zyxwvutsrqponmlkjihgfedcba", 26);
|
||||
}
|
||||
18
ex3/ft_print_numbers.c
Normal file
18
ex3/ft_print_numbers.c
Normal file
@@ -0,0 +1,18 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_print_numbers.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/03/04 10:06:13 by lclerel- #+# #+# */
|
||||
/* Updated: 2026/03/04 10:07:17 by lclerel- ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void ft_print_numbers(void)
|
||||
{
|
||||
write(1, "0123456789", 10);
|
||||
}
|
||||
27
ex4/ft_is_negative.c
Normal file
27
ex4/ft_is_negative.c
Normal file
@@ -0,0 +1,27 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_is_negative.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/03/04 10:08:57 by lclerel- #+# #+# */
|
||||
/* Updated: 2026/03/04 10:12:51 by lclerel- ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void ft_is_negative(int n)
|
||||
{
|
||||
char c;
|
||||
|
||||
if (nb >= 0)
|
||||
{
|
||||
c = 'P';
|
||||
}
|
||||
else
|
||||
{
|
||||
c = 'N';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user