Semantics is the study of word meaning. It is the meaning and content of a piece of information. Transferred to computer science, this means that the semantic aspect of information depends on characters and their arrangement.
In a program, the meaning content is represented by program lines. Since computers have no interpretation possibilities, the program lines must consist of an exact syntax and an unambiguous semantics. For this purpose the semantic language elements are represented by characters, digits and commands.
In various programming languages, the semantics has a formal character and includes logical and algebraic elements. Therefore, it is also called formal semantics. In natural languages, the word meaning is given by uniquely defined terms and objects.