Going from Python to C

This is a short tutorial created for students who took the MC102 course using the Python programming language and must take the MC202 course using the C programming language.

The purpose of this tutorial is to familiarize @ student with the syntax and the C constructs. The course will quickly introduce the C programming language, but having completed the tutorial is recommended for a more gradual and friendly transition between the two programming languages.

The tutorial consists of a few short tasks, ranging from simpler tasks to slightly more elaborate tasks. In each of them, an invitation will be made to write and test a small C program, going through the various programming phases and comparing it with a corresponding Python program. Book a time to do each one and have fun programming!


Task 0 - Introduction to the C language

Read the introduction text to C for Python programmers by Carl Burch, Hendrix College. This link contains a translation into Portuguese made for this discipline.

Task 1 - Mini calculator

In this task you must learn to declare variables, read from the keyboard and write on the screen.

Task 2 - Slug Marathon

You must learn to declare and use static vectors.

Task 3 - Approval Criteria

You must learn to separate the code into functions in addition to passing and receiving vectors by function.

Task 4 - Speaking like Chives

You should learn the differences between Python and C strings in addition to creating and working with C strings.

Task 5 - Word Search

You must learn to work with C matrices and solve more elaborate problems.