C Piscine Exam 01

The C Piscine Exam 01 is a pivotal moment in the 42 Network’s intensive "Piscine" (swimming pool) bootcamp. Coming just after the first week of drowning in logic puzzles and shell commands, this exam represents the first true test of a student’s ability to translate abstract logic into functional C code under pressure. The Crucible of the Exam The exam isn’t just about coding; it’s about resilience . Unlike the group-oriented "Rush" projects or peer-corrected daily exercises, Exam 01 is a solitary experience. Students are stripped of their greatest resource—the internet and their peers—and left only with a terminal and their own memory. The environment is notoriously strict. A single misplaced semicolon, a forgotten newline in a ft_putchar function, or a "Norminette" (coding style) violation can result in a failing grade for a specific problem. This teaches a vital lesson early in a programmer's career: precision matters. In the Piscine, "almost working" is functionally identical to "not working at all." Core Concepts Tested While the specific problems vary, Exam 01 generally focuses on the fundamental building blocks of C: The Main Function: Understanding how a program starts and how it interacts with the operating system. Variable Manipulation: Grasping types, scope, and the basic arithmetic that drives logic. Control Structures: Navigating the flow of a program using if/else statements and while loops. Standard Output: Often involving the creation of functions like ft_putstr or ft_putnbr , which require a deep understanding of how characters and integers are represented in memory. The Psychology of "The Machine" The most daunting part of Exam 01 is the Grading Machine . After pushing code, a student must wait for an automated system to verify their work. The tension of waiting for a "Success" or "Failure" notification is a rite of passage. If you fail a question, you are often sent back to a similar (or the same) problem, forcing you to confront your mistakes immediately. This feedback loop creates a high-stakes learning environment. It isn't just checking if you know C; it's checking if you can remain calm when the clock is ticking and your logic isn't compiling. Conclusion Ultimately, Exam 01 is less about the complexity of the code and more about foundational mastery . It separates those who are merely copying syntax from those who are beginning to think like a computer. Passing it provides a massive boost in confidence, signaling that the "swimmer" has survived the first deep-water test and is ready for the more complex algorithms and data structures that lie ahead. Are you currently preparing for this exam, or

Note: This guide is based on the standard 42 Network curriculum. The specific order of questions may vary slightly depending on your campus or the specific "Exam Tray" (Randomizer) you are assigned, but the concepts remain consistent.

🏊‍♂️ C Piscine Exam 01 Survival Guide Exam 01 is usually the first serious hurdle. It bridges the gap from basic syntax to actual algorithmic logic. The primary focus is on Loops , Conditions , and Arithmetic logic . 📜 The Rules of the Game

Time: Usually 3 hours. Scale: Grading is usually out of 4 points. Traces: You will see traces (inputs/outputs) or function prototypes. You must recreate the logic. Restrictions: You cannot use printf unless the subject explicitly asks for it. You cannot use standard library functions (like strlen , atoi ) unless explicitly allowed. Write it yourself. c piscine exam 01

🗺️ The Layout (Standard Order) Level 0: The Warm-up 1. aff_a

Task: Write a program that takes a string as an argument and displays 'a' if the string contains one, followed by a newline. If no 'a', just newline. Logic: Loop through argv[1] . If str[i] == 'a' , write it. Note: Some versions ask to display 'a' regardless, others only if found. Check the subject text carefully. Key Concept: write , main(int argc, char **argv) .

2. aff_first_param

Task: Display the first command-line argument. Logic: Check if argc > 1 . If so, loop through argv[1] and write characters. If no args, just newline. Key Concept: Accessing argv .

Level 1: Strings & Conditions 3. aff_last_param

Task: Display the last command-line argument. Logic: The last argument is at argv[argc - 1] . Loop and write that string. The C Piscine Exam 01 is a pivotal

4. aff_z

Task: Write a program that displays 'z' followed by a newline. Logic: Hardcode write(1, "z\n", 2) . Often the subject contains a confusing paragraph about parameters—ignore it. It's a trick. Just print 'z'.