> For the complete documentation index, see [llms.txt](https://mentebinaria.gitbook.io/manual-da-linguagem-gnu-c/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mentebinaria.gitbook.io/manual-da-linguagem-gnu-c/2.-um-programa-completo/programa-completo-linha-por-linha.md).

# Programa Completo Linha por Linha

Aqui está o mesmo exemplo explicado linha por linha. **Iniciantes, vocês acham que esta seção ajuda ou não? Vocês gostariam de um&#x20;*****layout*****&#x20;diferente por exemplo? Por favor, escreva para <rms@gnu.org> (em inglês).**

```c
#include <stdio.h>      /* Inclui as declarações de funções */
                        /*   de E/S comuns como a printf.  */
                        /* A maiora dos programas precisa delas.  */

int                     /* Essa função retorna um int.  */
fib (int n)             /* O nome dela é fib;  */
                        /*   seu argumento é o n.  */
{                       /* Início do corpo da função.  */
  /* Evita que a recursão seja inifinta.  */
  if (n <= 2)           /* Se n é 1 ou 2,  */
    return 1;           /*   faça com que fib retorne 1.  */
  else                  /* do contrário, some os dois números  */
                        /* Fibonacci anteriores.  */
    return fib (n - 1) + fib (n - 2);
}

int                     /* Essa função retorna um int.  */
main (void)             /* Comece aqui; ignore os argumentos.  */
{                       /* Imprima a mensagem com os números.  */
  printf ("Fibonacci series item %d is %d\n",
          20, fib (20));
  return 0;             /* Termine programa, reporte successo.  */
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://mentebinaria.gitbook.io/manual-da-linguagem-gnu-c/2.-um-programa-completo/programa-completo-linha-por-linha.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
