After compiling and linking your executable file contains several segments. Two types of these segments:
- text segments - containing the actual code
- data segments - containing static data.
(there are other types)
The value 10 is stored either in the text segment (as an instruction for setting 10 to a specific address or register), or stored as data in a data segment (which is extracted by code and stored at a specific address / register).
The compiler decides which is better (most effective for given compilation flags). But I believe that it is “stored” in the text segment, since the value 10 is pretty simple to “create in code” (as some other answers show).
More complex data (structures, rows, etc.) is usually stored in the data segment.
Veger source share