Escolar Documentos
Profissional Documentos
Cultura Documentos
Datatypes
int, float, .. (as in Java)
char* (instead of String)
Exercise Lecture 11. January no boolean
Functions
(0 is false, everything else true)
Output:
Value: (7.000000, -1.000000i).
We recommend you to buy a “C”-book to use as Simple exercise to get you started with C-programming
Task 1:
language reference throughout the course Configure your development environment.
“The C Programming Language”, by Brian Kernighan Write a “Hello world” program.
and Dennis Ritchie is the reference for C programming. Task 2:
Most other books will, however, also suffice. Pick one Write a “Guess a number between 1 and 100” program.
you like. Separate program into several functions in separate source-files
(probably overkill, but useful for learning)
A “C”-reference will come in handy in later Learn how to use printf(…) to display output, and scanf(…) for
programming-intensive courses. reading keyboard input.
The C standard library API is linked to from the course Task 3:
Create a “3D-vector” datastructure, and implement functions for
website. vector addition, subtraction, as well as dot- and cross-product.
Write some code that demonstrates this functionality.
make
compiles program (executes “default” script)
./main
executes program