Escolar Documentos
Profissional Documentos
Cultura Documentos
Qno.2 Differentiate between high level and low level language with examples.
Difference between high and low level language:
High level language Low level language
1. The high level language is in human readable 1. Low level language is machine readable form of
form of program. program.
2. High level language is easy to write as well as 2. Low level language are difficult to write and
easy to compile. compile.
3. High level language uses compilers and 3. Low level language are compact and require less
interpreters which requires large memory memory space.
space.
4. In high level language debugging (Finding and 4. In low level language debugging (Finding and
correcting errors) is easier. correcting errors) is difficult.
5. High level language coding and compiling is 5. Low level language coding and compiling is time
much easy and takes very less time to compile. consuming process.
6. Example: BASIC, FORTRAN, Java, C++ and 6. Example: Assembly language.
Pascal.
Qno.3 Differentiate between Variables and Constants in C++.
Difference between constant and variable:
Constant Variable
1. Constant can never change their value. 1. Variables can change their value.
2. Constant is the named memory location whose 2. Variable is the named memory location whose
value can't be changed or whose value is fixed value can be change during execution of
during the execution of the program. program.
3. Constants must be initialized at the time of their 3. Variables can be initialize after its declaration
deceleration.
4. Pie is a good example to declare as a constant. 4. a=5; where a is variable.
Example:
Grade, GradeOnTest are variable names that are acceptable.
Grade (Test), GradeTest#1 are variable names that are not acceptable.
Qno.6 Explain the difference between flowchart and pseudocode.
Qno.7 what are data types? Explain main data types in C++.
Data Types:
All variables use data-type during declaration to restrict the type of data to be
stored. Therefore, data types are used to tell the variables the type of data it can store.
Whenever a variable is defined in C++, the compiler allocates some memory for that
variable based on the data-type with which it is declared. Every data type requires
different amount of memory.
Main Data types:
Integer:
Keyword used for integer data types is int. Integers typically requires 4 bytes of memory
space and ranges from -2147483648 to 2147483647.
Character:
Character data type is used for storing characters. Keyword used for character data type
is char. Characters typically requires 1 byte of memory space and ranges from -128 to
127 or 0 to 255.
Boolean:
Boolean data type is used for storing Boolean or logical values. A Boolean variable can
store either true or false. Keyword used for Boolean data type is bool.
Floating Point:
Floating Point data type is used for storing single precision floating point values or
decimal values. Keyword used for floating point data type is float. Float variables
typically requires 4 byte of memory space.
Double Floating Point:
Double Floating Point data type is used for storing double precision floating point values
or decimal values. Keyword used for double floating point data type is double. Double
variables typically requires 8 byte of memory space.
Void:
Void means without any value. Void data type represents a valueless entity. Void data
type is used for those function which does not returns a value.