Introduction to Programming Languages
A programming language is a set of instructions and syntax used to create
software programs. Some of the key features of programming languages
include:
Syntax: The specific rules and structure used to write code in a programming
language.
Data Types: The type of values that can be stored in a program, such as
numbers, strings, and booleans.
Variables: Named memory locations that can store values.
Operators: Symbols used to perform operations on values, such as addition,
subtraction, and comparison.
Control Structures: Statements used to control the flow of a program, such as
if-else statements, loops, and function calls.
Libraries and Frameworks: Collections of pre-written code that can be used to
perform common tasks and speed up development.
Paradigms: The programming style or philosophy used in the language, such
as procedural, object-oriented, or functional.
• Most of us have heard that CPU is called the brain of our computer because it accepts
data, provides temporary memory space to it until it is stored(saved) on the hard disk,
performs logical operations on it and hence processes(here also means converts) data
into information.
• We all know that a computer consists of hardware and software. Software is a set of
programs that performs multiple tasks together. An operating system is also software
(system software) that helps humans to interact with the computer system.
• A program is a set of instructions given to a computer to perform a specific operation. or
computer is a computational device that is used to process the data under the control of
a computer program.
• While executing the program, raw data is processed into the desired output format.
These computer programs are written in a programming language which are high-level
languages. High level languages are nearly human languages that are more complex
than the computer understandable language which are called machine language, or low
level language.
• So after knowing the basics, we are ready to create a very simple and basic program.
Like we have different languages to communicate with each other, likewise, we have
different languages like C, C++, C#, Java, python, etc to communicate with the
computers. The computer only understands binary language (the language of 0’s and 1’s)
also called machine-understandable language or low-level language but the programs
we are going to write are in a high-level language which is almost similar to human
language.
• Hierarchy of Computer language –
• Characteristics of a programming Language –
• A programming language must be simple, easy to learn and use, have good
readability, and be human recognizable.
• Abstraction is a must-have Characteristics for a programming language in
which the ability to define the complex structure and then its degree of
usability comes.
• A portable programming language is always preferred.
• Programming language’s efficiency must be high so that it can be easily
converted into a machine code and its execution consumes little space in
memory.
• A programming language should be well structured and documented so
that it is suitable for application development.
• Necessary tools for the development, debugging, testing, maintenance of a
program must be provided by a programming language.
• A programming language should provide a single environment known as
Integrated Development Environment(IDE).
• A programming language must be consistent in terms of syntax and
semantics.
• Basic Terminologies in Programming Languages:
• Algorithm: A step-by-step procedure for solving a problem or performing a task.
• Variable: A named storage location in memory that holds a value or data.
• Data Type: A classification that specifies what type of data a variable can hold, such
as integer, string, or boolean.
• Function: A self-contained block of code that performs a specific task and can be
called from other parts of the program.
• Control Flow: The order in which statements are executed in a program, including
loops and conditional statements.
• Syntax: The set of rules that govern the structure and format of a programming
language.
• Comment: A piece of text in a program that is ignored by the compiler or interpreter,
used to add notes or explanations to the code.
• Debugging: The process of finding and fixing errors or bugs in a program.
• IDE: Integrated Development Environment, a software application that provides a
comprehensive development environment for coding, debugging, and testing.
• Operator: A symbol or keyword that represents an action or operation to be
performed on one or more values or variables, such as + (addition), – (subtraction), *
(multiplication), and / (division).
• Statement: A single line or instruction in a program that performs a specific action or
operation.
• Compiling a C Program: Behind the Scenes
• The compilation is the process of converting the
source code of the C language into machine
code. As C is a mid-level language, it needs a
compiler to convert it into an executable code
so that the program can be run on our machine.
• The C program goes through the following
phases during compilation: