Presidency University, Bengaluru
Presidency University, Bengaluru
A programming language is a formal language, which comprises a set of instructions used to produce various kinds of output. Programming
languages are used to create programs that implement specific algorithms.
Programs range from tiny scripts written by individual hobbyists to huge systems written by hundreds of programmers.
Programmers range in expertise from novices who need simplicity above all else, to experts who may be comfortable with considerable
complexity.
Programs must balance speed, size, and simplicity on systems ranging from microcontrollers to supercomputers.
Programs may be written once and not change for generations, or they may undergo continual modification.
Programmers may simply differ in their tastes: they may be accustomed to discussing problems and expressing them in a particular
language.
Requirements
S.NO. Topic List
User Compiler Run-Time
1 Data Type Deci The User has to specify Compiler assigns the During run-time the data
BigD the Data type before the memory space required for allocated to a Data Type
Text declaration of the specific data types. is used for execution.
Variable variable. Once assigned the Data i.e….it is specific.
Word Ex- Types cannot be changed
Bool Text name# at the run-time.
Integer Integer x# i.e.… they are static.
Long Int
2 Special Data type Date User has to specify the Compiler assigns the During run-time the data
Time Data type before the memory space required for allocated to a Data Type
NULL declaration of the specific data types. is used for execution.
Resource variable in the specified Once assigned the Data Sometimes from the run-
format. Types cannot be changed time stack.
Ex- at the run-time. That means ....it is very
Date 17-05-1999# The format is specified by specific.
DD-MM-YYYY# the user
3
3 Arithmetic Operators + add User needs to take care Compiler assigns the The run-time takes care
- subtract about the operand memory space required for of the mathematical
* multiply placement specific data types. operation
/ divide i.e.… Once assigned the Data And Data type parsing.
% modulus operator The operator should be The conversion from string
preceded and ended by to binary and back to String During run-time the
any variable. is taken care by the result of the operation is
Example- compiler printed.
Op3=op1+op2# These specified formats are
used as variables for
computation
4 Logical Operators || or User needs to take care The compiler degenerates During the run-time the
&& and about the placement of the multiple logical return value is passed to
! not various logical statements and returns the the function and
// implication statements before and Boolean value for the executed
//\\ if and only if after the logical operator operation.
The precedence of the
operator is also taken care
by the compiler.
i.e..
1 if true
0 if false
4
5 Expressions User needs to specify the The compiler checks for the During run-time the
parenthesis for rightness of the computation takes place .
"K=x*t+7;" or expressions. parenthesis by the
"func1(func2(func3()));" In order of the execution parenthesis checking
to happen. algorithm.
And the machine code is
generated.
Array(100)# The length of the array The assignment of
should be specified by The parenthesis checking memory in the heap is
the user in braces. happens as usual and the taken care at the run-
Data type is assigned time if Dynamically
during the compile time. typed.
6 Conditional Statements Syntax for enclosing the The compiler checks for the The conditions are
Arithmetic if condition in the rightness of the checked during the run-
If-else conditional statements parenthesis by the time and the specific item
If-then-otherwise should be known by the parenthesis checking is returned as specified n
user algorithm. the condition if true .
7 Loop statements For loop Syntax for enclosing the The compiler checks for the The loops are executed
While loop condition in the loop rightness of the during the run-time and
Do while loop statements should be parenthesis by the the values are returned if
Do loop known by the user parenthesis checking Loop conditions are
And the indentation algorithm. satisfied.
should be taken care by And the machine code is
user generated if the Syntax is
right.
8 Input statement Insert User should know that insert keyword inputs the load keyword inputs the
load the insert keyword inputs value into the memory. value dynamically during
the value into the And the machine code is execution.
memory generated if the Syntax is The statements are
5
10 Assignment Statements 1. var list := {0, 1} User should take care The static assignment of The dynamic assignment
a, b := list only of the syntax. the values takes place of values is taken care
2. <data type> during during the run-time.
<variable Compile time.
name> Same in case of
= parenthesis checking.
<value>
&->is used for dynamic
assignment
11 Array or list Array() User should consider the The implementation of the The computations on
List() syntax and the data data structures takes place these structures takes
Tree() structure involved in the during the compile time place during the run-time
Queue() declaration of these The few structures are Even stack allocation
Stack() variables predefined takes place during run-
time
12 User Defined data types Structure () User should consider the The indentation and the The computations on
Union() syntax and the data code checking takes place these structures takes
Graph() structure involved in the during the compile time. place during the run-time
Tree() declaration of these Even stack allocation
variables takes place during run-
6
time
13 Sub programs Macros() The user needs to focus The compiler takes care of These sub programs are
Functions() only on the syntax the implementation details called to execute and
Methods() required for execution as and the structures involved return some finite values.
the implementation by checking the Syntax.
details are hidden
14 Parameters Similar to the Data type The user has to pass the The compiler checks for the parameters are
declaration values of the parameters indentation and passed to and from sub
during the code parenthesis correctness programs into the main
generation program
15 Syntax of the program Start The user needs to specify The compiler needs to No requirement during the
End the start and for every return the control to OS Runtime as everything is
program. when the program ends. taken care by the compiler
Start defines where the and the user.
program has to be
conceded The compiler takes care
End tells where the of the end of the
program has to terminate statement and checks if Since syntax is checked by
the # is present at the the compiler the run-time
# End of a statement is end functionality is NULL.
specified by an # by the
user
7