Javatpoint Logo

91-9990449935

 0120-4256464

Pascal Interview Questions

There is given Pascal interview questions and answers that has been asked in many companies. Let's see the list of top Pascal interview questions.


1) What is Pascal?

Pascal is a procedural programming language developed in 1970 by Niklaus Wirth. It is a small and efficient programming language which supports data structure and structured programming.


2) What are some distinguish features of Pascal?

Following are some specific features of Pascal:

  • Structured programming language that uses control structures like if-else, repeat-until statement.
  • Provide simplicity and modular approach for machine implementation.
  • Having different data structures that are included with the records, arrays, files, pointers, etc.
  • Offer extensive error checking.
  • Support object oriented programming.

3) Why is it named Pascal?

It is named in the honor of a great French mathematician and philosopher Blaise Pascal.


4) What is a datatype? What are the different data types included in Pascal?

A datatype specifies a range of values that a variable can store. It also includes the set of operations that are performed on different datatypes.

Different data types included in Pascal

  • Integers: It includes whole number, which allows numbers to be written without any decimals.
  • Real Numbers: it includes numbers with decimal or without decimals.
  • Boolean Data Types: It checks the condition true or false.
  • Char Data Type: It allows a single character to be written with the ordered character set.

5) What is the different pointer types used in Pascal?

Following are the different pointer types used in Pascal:

  • Record Pointer: It is used to allow the recording of the node and the sub-fields that are used.
  • Reference Pointer: It specifies the reference to the dynamically created variables.
  • Associate Pointer: They have an associated data type with them that they can check for compatibility with another type.

6) What is IP Pascal?

IP Pascal stands for Interplatform Pascal. It supports the following platform in its current configuration:

  • Windows /95/98/ME/NT/2000/XP.
  • Linux/86.

7) What is unit in Pascal?

Modules of Pascal programs are referred as units. A module or unit contains some code blocks, which contain variables and type declarations, statement procedures etc. There are many built-in units in Pascal.


8) What is the reason behind using UNITS in Pascal programming?

There are three reasons to use UNITS in programming:

  • Simplicity: It simplifies the use of same code in some other programs to do the same job.
  • Easy to handle: It makes handling easy because some large programs are split into smaller section.
  • Easy to call: Putting codes in UNIT, makes it easy to call and use it again.

9) What are the different Pascal standards?

The first Pascal standard was documented by the author of the Pascal programming language Niklaus Wirth but it was an unofficial Pascal standard.

The first official standard was ISO 7185 issued in 1983. It was followed by the extended standard ISO 10206 in 1990. Another standard Object-Oriented Extension to Pascal was introduced but never completed due to lack of interest.


10) What is constant in Pascal? What constants are declared in Pascal?

Constants are something that remains unchanged during program execution. Pascal declares the following constants:

  • Ordinal Types
  • Set Types
  • Pointer Types
  • Real Types
  • Char
  • String

11) What syntax should be used to declare constants?

The following syntax is used to declare constants:

Const

Identifier = constant_value;

12) How file is handled in Pascal?

TIn Pascal, a file is a sequence of components, and file is determined by the type of the components.

type

file-name = file of base-type;

The base type determines the type of the component. It could be anything like Boolean, subrange, integer, record, arrays etc.


13) How can you make EXE file with Turbo Pascal?

To make EXE file with Turbo Pascal, follow these instructions:

  • Go to compile menu in turbo Pascal
  • Select COMPILE TO MEMORY
  • Open the menu again
  • Compile to disk will appear
  • Select compile
  • Select compile

14) What is Constructor and Destructors for Pascal Object?

Constructors:Constructor is a special type of method, which is called automatically whenever an object is formed. You can create a constructor in Pascal just by declaring a method with keyword. This method is known as Init method.

Destructors:Destructor is a method, which is used to destroy the memory allocation created by constructors


15) What are the types of loops in Pascal?

There are three types of loops in Pascal:

  • Fixed Repetition: It specifies that the loop is repeated only a fixed number of times.
  • Pretest: It first tests the Boolean expression, and then goes into a loop if the condition is TRUE.
  • Posttest: It executes the loop first, and then tests the Boolean expression.

16) Is Pascal designed to be a teaching language?

Or

Why Pascal is called teaching language?

It is often said that Pascal is a toy language and not to built for real-world programming. Check, what the father of Python Niklaus Wirth said:

"Occasionally, it has been claimed that Pascal was designed as a language for teaching. Although it is correct, its use in teaching was not the only goal. In fact, I don't believe in using tools and formalisms in teaching that are inadequate for any practical task." - Niklaus Wirth from the 1984 ACM A.M. Turing award lecture


17) What is the difference between apple Pascal and UCSD Pascal?

  • UCSD Pascal: UCSD Pascal is a Pascal programming language system, run on UCSD p-system a portable, highlymachine-independent operating system.
  • Apple Pascal:Apple Pascal is a language and operating system based on the UCSD Pascal system.

18) Is there any Freeware Pascal compiler?

Yes. One of the most recent and active freeware Pascal compilers is FPK Pascal. It is a 32 bit Turbo Pascal compatible compiler system for DOS and OS/2.

19) What is the Pascal compiler used on HPCVL machines?

The Pascal compiler installed on the Sun Fire system of HPCVL is the Gnu Pascal Compiler (GPC). It is a public-domain compiler that has a great deal of extensions and compatibility features built within it. It is portable.