Multiple choice technology programming languages

In the following segments which is the read only segment?

  1. Heap

  2. Stack

  3. Code Segment

  4. Data Segment

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The code segment (also called the text segment) stores the program's compiled machine instructions and is read-only to prevent self-modification. Heap and stack are dynamic memory areas used for read-write operations during program execution, while the data segment contains initialized and uninitialized global/static variables that can be modified.