[Courses] [C] Beginner's Lesson Five: K's Answers to the Exercises

KWMelvin kwmelvin at intrex.net
Sun Oct 13 10:46:24 EST 2002


Greetings,

Here are my answers to the exercises at the end of Beginner's
Lesson Five.  If you haven't done those exercises yet, please
try them before looking at my answers.  If you're stumped on
one of the problems, you are welcome to look at my answers,
if you think that will help you.

I was stumped on exercise 5-1.  The solution that you will see
uses an #include <math.h> and the sqrt() function.  I added the
-lm option to gcc when compiling because the math library needs
it.  I really can't see where we've covered <math.h> or sqrt()
in any of the previous lessons, but I couldn't think of any
other way to solve this exercise.  I'm sorry.

I am attaching each C program to this email so I won't have to
type them all into mutt again.  They are text files, so I don't
think that will make any differnce at all as far as size goes.
Binary attachments are not allowed.

Happy Programming!
--
K

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ex5-1.c
Type: text/x-csrc
Size: 927 bytes
Desc: not available
Url : http://linuxchix.org/pipermail/courses/attachments/20021013/4804124c/ex5-1.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ex5-2.c
Type: text/x-csrc
Size: 629 bytes
Desc: not available
Url : http://linuxchix.org/pipermail/courses/attachments/20021013/4804124c/ex5-2.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ex5-3.c
Type: text/x-csrc
Size: 1206 bytes
Desc: not available
Url : http://linuxchix.org/pipermail/courses/attachments/20021013/4804124c/ex5-3.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ex5-4.c
Type: text/x-csrc
Size: 814 bytes
Desc: not available
Url : http://linuxchix.org/pipermail/courses/attachments/20021013/4804124c/ex5-4.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ex5-5.c
Type: text/x-csrc
Size: 568 bytes
Desc: not available
Url : http://linuxchix.org/pipermail/courses/attachments/20021013/4804124c/ex5-5.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ex5-6.c
Type: text/x-csrc
Size: 1026 bytes
Desc: not available
Url : http://linuxchix.org/pipermail/courses/attachments/20021013/4804124c/ex5-6.c


More information about the Courses mailing list