Exercises for Week 1

Exercises are done in the "paja".

Mandatory exercises are marked with gray background.

We recommend using an IDE for programming (a good choice is NetBeans). A tutorial on starting C-programming with NetBeans can be found here (TODO:ADD). Before you know what you're doing, do exactly as the tutorial shows you. If you get stuck in a problem, ask for guidance immediately.

The tutorial shows how to create a project in which the program is created. Usually there is a separate project for each program. Create own projects for the first few exercises so that you learn the routine on how to create them. After that, you can make simple exercises to the same project. If you don't know how this can be done, ask for guidance.

In order to check and find the exercises later, we recommend two things:

Most of the assignments for this week show what the program should output in order for it to work correctly. If you don't understand the assignment, or the assignment seems unclear, ask for guidance from the tutors or someone sitting close to you. If an assignment is unclear, the fault lies always in the people creating the assignments.

Printing

In the following exercises we first get familiar with the environment and printing. Printing can be done using the printf-function.

Make sure you've gotten familiar with the programming environment before starting. A tutorial can be found here.

Hello You!

Write a program which prints your name on the screen. Even if you are not using an IDE for C, do this exercise in an IDE.

Simeon Student

Variable Values

Write a program which prints the values of three variables. Use char, int and float as the variable types. Assign any values you want, and try your program with more than one value. The output can be for example the following with char 'a', int 34 and float 432.2.

char: a
int: 34
float: 432.2