Ahsan Raza Programming Fundamentals
Ahsan Raza Programming Fundamentals
Submitted by:
Ahsan Raza
Submitted To:
Sir Asad Meraj
Roll No:
Bsf2005185
Date:
02-10-2022
Department:
BS Mathematics
Semester:
5th Semester
Shift:
Evening
University of Education
Lahore (Multan Campus
1_What are High and Low level Languages?
What are High-Level Languages?
One can easily interpret and combine these languages as compared to the low-level languages.
They are very easy to understand.
Such languages are programmer-friendly.
Debugging is not very difficult.
They come with easy maintenance and are thus simple and manageable.
One can easily run them on different platforms.
They require a compiler/interpreter for translation into a machine code.
A user can port them from one location to another.
Such languages have a low efficiency of memory. So it consumes more memory than the low-level languages.
They are very widely used and popular in today’s times.
Java, C, C++, Python, etc., are a few examples of high-level languages.
What are Low-Level Languages?
They are also called machine-level languages.
Machines can easily understand it.
High-level languages are very machine-friendly.
Debugging them is very difficult.
They are not very easy to understand.
All the languages come with complex maintenance.
They are not portable.
These languages depend on machines.Thus, one can run it on various platforms.
They always require assemblers for translating instructions
Low-level languages do not have a very wide application in today’s times.
What is an Interpreter:
An interpreter transforms or interprets a high‐level programming code into code that can be understood by the machine
(machine code) or into an intermediate language that can be easily executed as well. The interpreter reads each statement of
code and then converts or executes it directly.
Compiler:
1 Compiler works on the complete program at once. It takes the entire program as input. Interpreter program works
line‐by‐line. It takes one statement at a time as input.
2 Compiler generates intermediate code, called the object code or machine code. Interpreter does not
generate intermediate object code or machine code.
3 Compiler executes conditional control statements (like if‐else and switch‐case) and logical constructs faster than
interpreter. Interpreter execute conditional control statements at a much slower speed.
4 Compiled programs take more memory because the entire object code has to reside in memory. Interpreter does
not generate intermediate object code. As a result, interpreted programs are more memory efficient.
5 Compile once and run anytime. Compiled program does not need to be compiled every time. Interpreted
programs are interpreted line‐byline every time they are run.
6 Errors are reported after the entire program is checked for syntactical and other errors. Error is reported as soon as
the first error is encountered. Rest of the program will not be checked until the existing error is removed.
7 A compiled language is more difficult to debug. Debugging is easy because interpreter stops and reports errors as it
encounters them.
Interpreter:
1 Interpreter program works line‐by‐line. It takes one statement at a time as input.
2۔ Interpreter does not generate intermediate object code or machine code.
4 Interpreter does not generate intermediate object code. As a result, interpreted programs are more
memory efficient.
5 Interpreted programs are interpreted line‐byline every time they are run.
6 Error is reported as soon as the first error is encountered. Rest of the program will not be checked until
the existing error is removed.
7 Debugging is easy because interpreter stops and reports errors as it encounters them.
Assembler:
An assembler is a program that takes basic computer instructions and converts them into a pattern of bits that the
computer’s processor can use to perform its basic operations.
3_What is IDE?
An integrated development environment (IDE) is a software application that helps programmers develop software
code efficiently. It increases developer productivity by combining capabilities such as software editing, building,
testing, and packaging in an easy-to-use application.
5_ASCII Table:
ASCII (which stands for American Standard Code for Information Interchange) is a character encoding standard for
text files in computers and other devices. ASCII is a subset of Unicode and is made up of 128 symbols in the
character set. These symbols consist of letters (both uppercase and lowercase), numbers, punctuation marks,
special characters and control characters. Each symbol in the character set can be represented by a Decimal value
ranging from 0 to 127, as well as equivalent Hexadecimal and Octal values.
The following is a listing of ASCII values displaying the Decimal, Hexadecimal, Octal and Character values for each
ASCII character.
32 20 040 Space
42 2A 052 * Asterisk
44 2C 054 , Comma
45 2D 055 - Hyphen/Minus
58 3A 072 : Colon
59 3B 073 ; Semicolon
In the ASCII character set, the Decimal values 0 to 31 as well as Decimal value 127 represent symbols that are non-
printable. It is possible to generate these non-printable characters using a key sequence where ^ represents the
control key on your keyboard. For example, you could generate a carriage return (Decimal value 13) by pressing
the control key followed by the letter M on your keyboard (^M).
All other symbols in the character set can printed or represented on the screen. These printable character values
can be seen in the Char field in the table above.
128 80 200
129 81 201
130 82 202
131 83 203
132 84 204
133 85 205
134 86 206
135 87 207
136 88 210
137 89 211
138 8A 212
139 8B 213
140 8C 214
141 8D 215
142 8E 216
143 8F 217
144 90 220
145 91 221
146 92 222
147 93 223
148 94 224
149 95 225
150 96 226
151 97 227
152 98 230
153 99 231
154 9A 232
155 9B 233
156 9C 234
157 9D 235
158 9E 236
159 9F 237
9_ are keywords in C?
The C language uses the following keywords:
Auto. Break. Case. Char. Const. Continue. Default. Do. Double. ...
Extern. Float. For. Goto. If. Inline 1, a int. Long. Register. ...
Short. Signed. Sizeof. Static. Struct. Switch. Typedef. Union. Unsigned. ...
While. _Alignas 2, a _Alignof 2, a _Atomic 2, b _Bool 1, a _Complex 1, b _Generic 2, a
_Imaginary 1, b