> For the complete documentation index, see [llms.txt](https://ruggedboard.gitbook.io/ruggedboard/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ruggedboard.gitbook.io/ruggedboard/master/hello-world/write.md).

# Write your first C program

**Step 1: Find a suitable text editor that suits you eg: Atom, Sublime text, vim, notepad ++, etc..**

**Step2: Write a small C code on your HOST PC and save it with a** `.c` **extension(eg:** `first.c`**). You can try our example code given below:**

```
#include <stdio.h>
int main()
{
	printf("Hello board!!");
	return 0;
}
```

**Step 3: Open your terminal (ctrl + alt + T), navigate to the Toolchain folder and enable the toolchain by running the env.sh file.**

**Step 4: Make sure the the toolchain is running on your PC by typing "arm" and hitting the \<TAB> key twice.**&#x20;

**Screenshot() to be added**

\
**NOTE: Do not close your terminal as it will disable the toolchain that is running. For any further execution of C program, use the current terminal itself and make sure your toolchain is enabled before executing the program.** &#x20;

**Step 5: Navigate back to your C folder and compile the C code using the toolchain enabled terminal.**\
`arm-linux-gnueabi-gcc first.c -o first` &#x20;

**Step 6: Open a Terminal on the board, Transfer the compiled binary `"first"` to the board either by TFTP or by SD Card. (**[**Click here to follow the process to transfer files from Host to Board**](/ruggedboard/master/hello-world/transferring-files-from-host-to-board.md)**)**

**Step 7: Give the necessary permissions** `chmod +x first`&#x20;

**Step 8: Run the binary using** `./first`&#x20;


---

# 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://ruggedboard.gitbook.io/ruggedboard/master/hello-world/write.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.
