Goal
- Learn how to compute square roots efficiently.
- Learn to use functions, while loops and for loops.
Checklist
Helpful Hints
Check out the course
Frequently Asked Questions list.
Many common questions are addressed here.
Customize emacs to automatically indent your code
and list line numbers.
Also, you can now compile your code without leaving emacs
by typing Ctrl-c Ctrl-c. If there is a syntax error,
typing Ctrl-c Ctrl-n will automatically highlight
it for you.
Check the FAQ page or ask a lab TA for assistance.
Change your shell to enable filename completion and command recall.
Check the FAQ page or ask a lab TA for assistance.
Change the default version of Netscape from 3.5 to 4.05.
Check the FAQ page or ask a lab TA for assistance.
Four Star Challenge (for hackers only)
Any student with a correct solution will be exempt from
the first midterm!
The above methods find a real root of a given function of
a single variable.
Write a C program that determines whether or not a given polynomial
function has an integral root.
For example,
if f(x) = 4x^3 - 8x^2 + 5x - 1, then x = 1 is the
unique integral root.
The challenge is to extend your program
to handle arbitrary multivariate polynomials as well.
For example, if f(x,y,z) = 6x^3yz^2 + 3xy^2 - x^3 - 10 then
(x,y,z) = (5,3,0) is an integral root.