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

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

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
