Exam 01 Piscine 42 Exclusive File

Write a function that returns the sign of a number, or a function that swaps the values of two integers using pointers ( ft_swap ).

At the login screen, you enter the credentials: exam / exam . Inside the terminal, you run kinit <username> followed by your password, and then examshell to launch the exam interface. The examshell is unlike any IDE you have used; it is a command-line test harness that will evaluate your code in a "black box" fashion.

You must save your files in the rendu/ directory provided by the system. exam 01 piscine 42 exclusive

Declaring variables in the middle of a function rather than at the top.

Crucially, the exams are . You cannot access the internet, your notes, or even ask your neighbor for help. The environment is stripped down to a terminal, an editor, and the examshell —a custom command-line interface used to submit your solutions. This forces you to rely entirely on your own understanding and muscle memory. Write a function that returns the sign of

The exam lasts several hours. If you get stuck on a level and fail an assignment, do not panic. Take a five-minute break, stretch, and let the retry penalty timer run down. Use that idle time to write out your logic on a piece of paper before touching the keyboard again. Final Thoughts: The Bigger Picture

While some campuses loosen Norminette (the 42 code style guide) restrictions during the earliest exams, writing clean, Norm-compliant code prevents unexpected formatting failures. Mental Management During the Exam The examshell is unlike any IDE you have

If you pass, the relief is tangible. If you fail, you still gain invaluable experience for Exam 02 and the Final Exam. Many students who score in the 30–40% range on Exam 01 go on to be accepted into the core program. "I passed the Piscine... I got as far as C06 and passed two out of four exams," shares one successful graduate.

char b = '0'; while (b <= '9')

| Case | a | b | Expected | Result | |----------------|-------|-------|----------|--------| | Both zero | 0x00 | 0x00 | 0x00 | pass | | Same non‑zero | 0xFF | 0xFF | 0x00 | pass | | Complement | 0x0F | 0xF0 | 0xFF | pass | | Single bit | 0x01 | 0x00 | 0x01 | pass | | Arbitrary | 0x5A | 0x3C | 0x66 | pass |

: Many successful participants solved this using recursion. The logic is elegant: