# principles of programming language

## Bubble Sorting with example in C/C++/Java

Bubble sorting is one of the simplest sorting algorithm that we can use to sort an array or a structure. Though it is so simple to implement in a C program, bubble sort is also considered as an inefficient sorting algorithm. Bubble sort comes handy in [...]

## How is ARM Programming Different?

Programming ARM MCUs – What is Different? There are very, very few engineers or electronics enthusiasts who started programming with ARM microcontrollers right away. Most come to ARM looking for higher processing capabilities, with a background in simple 8-bit MCUs. In the previous article on How [...]

## Difference between Procedure Oriented and Object Oriented Programming

We all know there exist 2 approaches to write a program – 1) Procedure oriented programming (POP) and 2) Object oriented programming (OOP). You can write a program in either way but there are notable differences between both approaches. These 2 approaches are the [...]

## What are the various syntactic representations for expression?

Ans. If we take expression as characteristically represented by trees, then in order to expression within programs some linearization of trees is required, that is, one must have a notation for writing trees as linear sequences fo symbols. The most commonly used syntactic representation [...]

## What are the language rules which specify the order of evaluation of operators?

Ans. The value of an expression depends at least in part on the order of evaluation of the operations in the expression. Consider the following expression 3 + 4 * 5 If evaluation left to right the result is 35. If evaluated right to left the [...]

## Discuss sequence control with arithmetic expressions.

Ans. Consider the following formula for computing roots of the quadratic equation – This apparently simple formula actually involves at least 15 separate operations. Coded in a typical assembly or machine language, it would require at least 15 instructions and probably far more. Moreover, the [...]

## What do you understand by variable initialization? Explain.

Ans. In many instances, it is convenient for variables to have values before the code of the program or subprogram in which they are declared being executing. The binding of a variable to a value at the time it is bound to storage is [...]

## Describe in detail is named constants.

Ans. A named constant is a variable that is bound to a value only once. Named constant are useful as aids to readability and program reliability. Readability can be improved, for example, by using the name pi instead of the constant 3.14159. Another important use [...]

## What is type equivalence? What are its approaches?

Ans. Type equivalence means that two types are equivalent if an operand of one type in an expression is substituted for one of the other type, without coercion. It is a strict form of type compatibility – compatibility without coercion. The design of the [...]

## Define type compatibility.

Ans. The type compatibility rules dictate the types of operands that are acceptable for each of the operators and thereby specify the possible type errors of the language. The rules are called compatibility because in some cases the type of an operand can be [...]