> For the complete documentation index, see [llms.txt](https://comphyslab-ay2023.phys.sc.chula.ac.th/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://comphyslab-ay2023.phys.sc.chula.ac.th/week-3-review-and-exercises.md).

# Week 3: Review and exercises

## <mark style="color:yellow;">Classwork - Week 3</mark>

Develop a C program that allows the user to input a polynomial function and select a root-finding method - either the Newton-Raphson method or the Bisection method. The program should then find and display the root of the polynomial based on the selected method. In addition, your program should display results from the loop in each method.

To simplify the program, you can try to focus on polynomial with upto 2nd degree in your program. Use what you have learned so far, including input-output, function, loops and control flows.

<mark style="color:orange;">**Useful function**</mark>: <mark style="color:green;">fabs(double n)</mark> in <mark style="color:green;">math.h</mark>. The fabs() function takes a single argument (in double) and returns the absolute value of that number (also in double).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://comphyslab-ay2023.phys.sc.chula.ac.th/week-3-review-and-exercises.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
