Difference: ProgrammingExercise (7 vs. 8)

Revision 82017-09-18 - uli

Line: 1 to 1
 
META TOPICPARENT name="CourseExercises"

Exercises 2: C Programming

Goal:

Line: 31 to 31
  Have a look at these examples, compile them and test them. Make sure you understand every little detail. If you don't: ask!
Added:
>
>
Type at least a few of them yourself using the text editor.
 The compile command is

gcc -o hello hello.c

Line: 38 to 40
 if the source code is in a file called hello.c The binary output file will be called hello and you can execute it with ./hello.

Exercise 2: Hello World!

Changed:
<
<
The first program to be written in C is traditionally the “Hello World!” program. We don’t want to change this tradition and you are therefore asked to write the program that prints “Hello World!”.
First compile it with the gcc command, then write a Makefile to build the program using the make command.
>
>
The first program to be written in C is traditionally the “Hello World!” program. We don’t want to change this tradition and you are therefore asked to write the program that prints “Hello World!”. Create a directory hello in ~/exercises/solutions/exercise_2 and create the source file hello.c in there.
Compile it with the gcc command and run the program to test it (./hello). What does the dot do?
 

Exercise 3: A calculator

We want to produce a calculator program capable of calculating the 4 basic calculations:

Line: 88 to 90
 
<--/commentPlugin-->
Changed:
<
<
META FILEATTACHMENT attachment="codeExamples.tar.gz" attr="" comment="" date="1504866315" name="codeExamples.tar.gz" path="codeExamples.tar.gz" size="3240" user="uli" version="1"
META FILEATTACHMENT attachment="exercises_2.odt" attr="" comment="" date="1505471107" name="exercises_2.odt" path="exercises_2.odt" size="21017" user="uli" version="1"
>
>
META FILEATTACHMENT attachment="exercises_2.odt" attr="" comment="" date="1505762906" name="exercises_2.odt" path="exercises_2.odt" size="21198" user="uli" version="1"
META FILEATTACHMENT attachment="newCodeExamples.tar.gz" attr="" comment="" date="1505765608" name="newCodeExamples.tar.gz" path="newCodeExamples.tar.gz" size="13591" user="uli" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback