+91 90691 39140 | +1 253 214 3115 | info@hub4tech.com | hub4tech

Pascal Interview Questions and Answers

1
What are the data types included in Pascal?
  • Data type defines a range of values that a variable can store. It also includes set of operations that are performed on different data types.
  • There is predefined data type as:
  • Integers are the whole numbers that allow only the numbers to be written without any decimal points.
  • The real numbers are treated as floating point numbers that can have decimals as well with the non-decimal digits.
  • Boolean data types define only the two values either it is true or false. In programming it can be used when there is a decision need to be made between the two entities.
  • Char data type allows the single character to be written in an ordered form with the ordered character set.
2
Explain what is Pascal?

Pascal is a procedural programming language which supports data structures and structured programming.

3
What is the procedure to perform string operations in Pascal?
  • Pascal can’t handle the string of characters and it is one of the disadvantages of the language.
  • String of characters uses lots of data elements and characters and there need to be character displacement using the string functions.
  • The procedure is as follows:
  • Declaration of the string take place and it is declared as the string of fixed length array like:
  • var string: packed array [1..50] of char;

  • The length of all the strings should be same and the length of the handler routines as well.
  • The size of the array can be made according to the requirement but, there is no assigning of the string constant to strings like:
  • string = 'hello, world';

  • The length of the string should be 100-200 characters.
4
Explain what is the reason for using UNITS?

There are three reasons to use units in programming

  • When you want to use the same code in some other program to do the same job
  • For ease of handling, some large programs are split into a smaller section
  • If you put code in a unit, it becomes easy to call and use it again
5
What are the different pointer types used in pascal?
  • Record pointers are the pointers that allow the recording of the node and the sub-fields that are being used.
  • Reference pointers: Pointers are the reference to the dynamically created variables that doesn’t allow the references to be done in static or local variables.
  • Associate type pointers: Pointers have an associated data type with them so that one type can be check for compatibility with another type.
  • It helps in eliminating the security concern and allows easy implementation of the pointer used in the language.
  • This allows the risk to be removed in case of using the dangling pointers and it dynamically allows the use of Dispose function that manages the risk.
  • Example of the pointer is as follows:
  • type
    pNode = ^Node;
    Node = record
    a : integer;
    b : char;
    c : pNode {extra semicolon not strictly required}
    end;
    var
    NodePtr : pNode;
    IntPtr : ^integer;

  • The NodePtr is a variable pointer that is pointing to the data type of Node that is a record. Pointers are used before they are declared.
Copyright ©2015 Hub4Tech.com, All Rights Reserved. Hub4Tech™ is registered trademark of Hub4tech Portal Services Pvt. Ltd.
All trademarks and logos appearing on this website are the property of their respective owners.
FOLLOW US