What Is Source Code? with example

 What Is Source Code? with example 

Source code is a collection of code (text-based instructions) that result in a computer program written using a high-level programming language. Seemingly, it is a collection of words, letters, and symbols, etc.

In order to be executed by a computer, those instructions have to be translated from the high-level language (source code) into a machine language understood by computers.

 This translation is done by a compiler or an interpreter and is what makes programs executable. 

A program can be run by executing its compiled form, using an interpreter, or, for more complex tasks, by directly executing its source code.

The source code of a program is usually held in one or more text files containing a large number of lines of code. The exact format of this file varies from one programming language to another, 

but programs usually have one or more files named with the extension .c, .cpp, .CPP or .cxx (e.g., filename.c).

 In most cases the file name matches the name of the main function or method of the program and the content of the file consists exclusively of that function definition and related declarations and statements.

Post a Comment

Previous Post Next Post