Assignment
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.
2_What is Compiler , Interpreter and Assembler in C?
What is compiler:
Compiler, computer software that translates (compiles) source code written in a high-level language (e.g., C++) into a set of
machine-language instructions that can be understood by a digital computer’s CPU. Compilers are very large programs, with
error-checking and other abilities
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.
3 Interpreter execute conditional control statements at a much slower speed.
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.
4_Why we Use Back slash n in c?
An escape sequence in C language is a sequence of characters that doesn’t represent itself when used inside string
literal or character. It is composed of two or more characters starting with backslash \. For example: \n represents
new line.
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.
Standard ASCII Characters
Dec Hex Oct Char Description
0 00 000 ^@ Null (NUL)
1 01 001 ^A Start of heading (SOH)
2 02 002 ^B Start of text (STX)
3 03 003 ^C End of text (ETX)
4 04 004 ^D End of transmission (EOT)
5 05 005 ^E Enquiry (ENQ)
6 06 006 ^F Acknowledge (ACK)
7 07 007 ^G Bell (BEL)
8 08 010 ^H Backspace (BS)
9 09 011 ^I Horizontal tab (HT)
10 0A 012 ^J Line feed (LF)
11 0B 013 ^K Vertical tab (VT)
12 0C 014 ^L New page/form feed (FF)
13 0D 015 ^M Carriage return (CR)
14 0E 016 ^N Shift out (SO)
15 0F 017 ^O Shift in (SI)
16 10 020 ^P Data link escape (DLE)
17 11 021 ^Q Device control 1 (DC1)
18 12 022 ^R Device control 2 (DC2)
19 13 023 ^S Device control 3 (DC3)
20 14 024 ^T Device control 4 (DC4)
21 15 025 ^U Negative acknowledge (NAK)
22 16 026 ^V Synchronous idle (SYN)
23 17 027 ^W End of transmission block (ETB)
24 18 030 ^X Cancel (CAN)
25 19 031 ^Y End of medium (EM)
26 1A 032 ^Z Substitute (SUB)
27 1B 033 ^[ Escape (ESC)
28 1C 034 ^\ File separator (FS)
29 1D 035 ^] Group separator (GS)
30 1E 036 ^^ Record separator (RS)
31 1F 037 ^_ Unit separator (US)
32 20 040 Space
33 21 041 ! Exclamation mark
34 22 042 “ Quotation mark/Double quote
35 23 043 # Number sign
36 24 044 $ Dollar sign
37 25 045 % Percent sign
38 26 046 & Ampersand
39 27 047 ‘ Apostrophe/Single quote
40 28 050 ( Left parenthesis
41 29 051 ) Right parenthesis
42 2A 052 * Asterisk
43 2B 053 + Plus sign
44 2C 054 , Comma
45 2D 055 - Hyphen/Minus
46 2E 056 . Full stop/Period
47 2F 057 / Solidus/Slash
48 30 060 0 Digit zero
49 31 061 1 Digit one
50 32 062 2 Digit two
51 33 063 3 Digit three
52 34 064 4 Digit four
53 35 065 5 Digit five
54 36 066 6 Digit six
55 37 067 7 Digit seven
56 38 070 8 Digit eight
57 39 071 9 Digit nine
58 3A 072 : Colon
59 3B 073 ; Semicolon
60 3C 074 < Less-than sign
61 3D 075 = Equal/Equality sign
62 3E 076 > Greater-than sign
63 3F 077 ? Question mark
Dec Hex Oct Char Description
64 40 100 @ Commercial at/At sign
65 41 101 A Latin capital letter A
66 42 102 B Latin capital letter B
67 43 103 C Latin capital letter C
68 44 104 D Latin capital letter D
69 45 105 E Latin capital letter E
70 46 106 F Latin capital letter F
71 47 107 G Latin capital letter G
72 48 110 H Latin capital letter H
73 49 111 I Latin capital letter I
74 4A 112 J Latin capital letter J
75 4B 113 K Latin capital letter K
76 4C 114 L Latin capital letter L
77 4D 115 M Latin capital letter M
78 4E 116 N Latin capital letter N
79 4F 117 O Latin capital letter O
80 50 120 P Latin capital letter P
81 51 121 Q Latin capital letter Q
82 52 122 R Latin capital letter R
83 53 123 S Latin capital letter S
84 54 124 T Latin capital letter T
85 55 125 U Latin capital letter U
86 56 126 V Latin capital letter V
87 57 127 W Latin capital letter W
88 58 130 X Latin capital letter X
89 59 131 Y Latin capital letter Y
90 5A 132 Z Latin capital letter Z
91 5B 133 [ Left square bracket
92 5C 134 \ Reverse solidus/Backslash
93 5D 135 ] Right square bracket
94 5E 136 ^ Circumflex accent/Caret
95 5F 137 _ Underscore/Low line
96 60 140 ` Grave accent
97 61 141 a Latin small letter a
98 62 142 b Latin small letter b
99 63 143 c Latin small letter c
100 64 144 d Latin small letter d
101 65 145 e Latin small letter e
102 66 146 f Latin small letter f
103 67 147 g Latin small letter g
104 68 150 h Latin small letter h
105 69 151 i Latin small letter i
106 6A 152 j Latin small letter j
107 6B 153 k Latin small letter k
108 6C 154 l Latin small letter l
109 6D 155 m Latin small letter m
110 6E 156 n Latin small letter n
111 6F 157 o Latin small letter o
112 70 160 p Latin small letter p
113 71 161 q Latin small letter q
114 72 162 r Latin small letter r
115 73 163 s Latin small letter s
116 74 164 t Latin small letter t
117 75 165 u Latin small letter u
118 76 166 v Latin small letter v
119 77 167 w Latin small letter w
120 78 170 x Latin small letter x
121 79 171 y Latin small letter y
122 7A 172 z Latin small letter z
123 7B 173 { Left curly bracket
124 7C 174 | Vertical line/Vertical bar
125 7D 175 } Right curly bracket
126 7E 176 ~ Tilde
127 7F 177 DEL Delete (DEL)
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.
Extended ASCII Characters
Dec Hex Oct Char Description
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
160 A0 240 No-break space
161 A1 241 ¡ Inverted exclamation mark
162 A2 242 ¢ Cent sign
163 A3 243 £ Pound sign
164 A4 244 ¤ Currency sign
165 A5 245 ¥ Yen/Yuan sign
166 A6 246 ¦ Broken bar
167 A7 247 § Section sign
168 A8 250 ¨ Diaeresis
169 A9 251 © Copyright sign
170 AA 252 ª Feminine ordinal indicator
171 AB 253 « Left-pointing double angle quotation mark
172 AC 254 ¬ Not sign
173 AD 255 Soft hyphen
174 AE 256 ® Registered trademark sign
175 AF 257 ¯ Macron
176 B0 260 ° Degree sign
177 B1 261 ± Plus-minus sign
178 B2 262 ² Superscript two
179 B3 263 ³ Superscript three
180 B4 264 ´ Acute accent
181 B5 265 µ Micro sign (mu)
182 B6 266 ¶ Pilcrow sign
183 B7 267 · Middle dot
184 B8 270 ¸ Cedilla
185 B9 271 ¹ Superscript one
186 BA 272 º Masculine ordinal indicator
187 BB 273 » Right-pointing double angle quotation mark
188 BC 274 ¼ Vulgar fraction one quarter
189 BD 275 ½ Vulgar fraction one half
190 BE 276 ¾ Vulgar fraction three quarters
191 BF 277 ¿ Inverted question mark
Dec Hex Oct Char Description
192 C0 300 À Latin capital letter A with grave
193 C1 301 Á Latin capital letter A with acute
194 C2 302 Â Latin capital letter A with circumflex
195 C3 303 Ã Latin capital letter A with tilde
196 C4 304 Ä Latin capital letter A with diaeresis
197 C5 305 Å Latin capital letter A with ring above
198 C6 306 Æ Latin capital letter AE
199 C7 307 Ç Latin capital letter C with cedilla
200 C8 310 È Latin capital letter E with grave
201 C9 311 É Latin capital letter E with acute
202 CA 312 Ê Latin capital letter E with circumflex
203 CB 313 Ë Latin capital letter E with diaeresis
204 CC 314 Ì Latin capital letter I with grave
205 CD 315 Í Latin capital letter I with acute
206 CE 316 Î Latin capital letter I with circumflex
207 CF 317 Ï Latin capital letter I with diaeresis
208 D0 320 Ð Latin capital letter ETH
209 D1 321 Ñ Latin capital letter N with tilde
210 D2 322 Ò Latin capital letter O with grave
211 D3 323 Ó Latin capital letter O with acute
212 D4 324 Ô Latin capital letter O with circumflex
213 D5 325 Õ Latin capital letter O with tilde
214 D6 326 Ö Latin capital letter O with diaeresis
215 D7 327 × Multiplication sign
216 D8 330 Ø Latin capital letter O with stroke
217 D9 331 Ù Latin capital letter U with grave
218 DA 332 Ú Latin capital letter U with acute
219 DB 333 Û Latin capital letter U with circumflex
220 DC 334 Ü Latin capital letter U with diaeresis
221 DD 335 Ý Latin capital letter Y with acute
222 DE 336 Þ Latin capital letter THORN
223 DF 337 ß Latin small letter sharp s
224 E0 340 à Latin small letter a with grave
225 E1 341 á Latin small letter a with acute
226 E2 342 â Latin small letter a with circumflex
227 E3 343 ã Latin small letter a with tilde
228 E4 344 ä Latin small letter a with diaeresis
229 E5 345 å Latin small letter a with ring above
230 E6 346 æ Latin small letter ae
231 E7 347 ç Latin small letter c with cedilla
232 E8 350 è Latin small letter e with grave
233 E9 351 é Latin small letter e with acute
234 EA 352 ê Latin small letter e with circumflex
235 EB 353 ë Latin small letter e with diaeresis
236 EC 354 ì Latin small letter i with grave
237 ED 355 í Latin small letter i with acute
238 EE 356 î Latin small letter i with circumflex
239 EF 357 ï Latin small letter i with diaeresis
240 F0 360 ð Latin small letter eth
241 F1 361 ñ Latin small letter n with tilde
242 F2 362 ò Latin small letter o with grave
243 F3 363 ó Latin small letter o with acute
244 F4 364 ô Latin small letter o with circumflex
245 F5 365 õ Latin small letter o with tilde
246 F6 366 ö Latin small letter o with diaeresis
247 F7 367 ÷ Division sign/Obelus
248 F8 370 ø Latin small letter o with stroke
249 F9 371 ù Latin small letter u with grave
250 FA 372 ú Latin small letter u with acute
251 FB 373 û Latin small letter u with circumflex
252 FC 374 ü Latin small letter u with diaeresis
253 FD 375 ý Latin small letter y with acute
254 FE 376 þ Latin small letter thorn
255 FF 377 ÿ Latin small letter y with diaeresis
6_Why we use f with print in printf in c?
‘f’ in printf stands for formatted data printing, it is used for printing with
formatted values as output
7_Whats stands for gcc in c?
GCC stands for “GNU Compiler Collection”. GCC is an integrated distribution of compilers for several
major programming languages. These languages currently include C, C++, Objective-C, Objective-C++,
Fortran, Ada, D, and Go.
8_ Flow chart... Diamond, oval, rectangular shapes .... Meaning?
The oval, rectangle, diamond, parallelogram and arrow are the basics. The oval marks the start/end. The
rectangle represents any step in the process, like tasks or actions. The diamond symbolizes a decision.
The parallelogram represents information that’s received/generated like an e-mail or product.
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