Why C is called a middle level language? Give a flowchart to explain the program execution process. Explain each step in detail. 10
C is called a middle level language
It is actually binding the gap between a machine-level language and high-level language. User can use C language to do System Programming (For writing Operating System) as well as Application Programming (For generating menu driven customer billing system) that is why it is called middle level language
C is referred to as middle level language as with C we are able to manipulate bits, bytes and addresses i.e. interact with the hardware directly. We are also able to carry out memory management functions
C is a general purpose, structured programming language. Among the two types of programming languages discussed earlier, C lies in between these two categories. That’s why it is often called a middle level language. It means that it combines the elements of high level languages with the functionality of assembly language. It provides relatively good programming efficiency (as compared to machine oriented language) and relatively good machine efficiency as compared to high level languages). As a middle level language, C allows the manipulation of bits, bytes and addresses – the basic elements with which the computer executes the inbuilt and memory management functions. C code is very portable, that it allows the same C program to be run on machines with different hardware configurations. The flexibility of C allows it to be used for systems programming as well as for application programming.
C is commonly called a structured language because of structural similarities to ALGOL and Pascal. The distinguishing feature of a structured language is compartmentalization of code and data. Structured language is one that divides the entire program into modules using top-down approach where each module executes one job or task. It is easy for debugging, testing, and maintenance if a language is a structured one. C supports several control structures such as while, do-while and for and various data structures such as strucs, files, arrays etc. as would be seen in the later units. The basic unit of a C program is a function – C’s standalone subroutine. The structural component of C makes the programming and maintenance easier.
DIAGRAMMATIC REPRESENTATION OF PROGRAM EXECUTION PROCESS
2. (a) Write a program to search an element in a given list of elements using linear search. 8
Solved program can be found on this link http://cssimplified.com/assignments/write-a-program-to-do-linear-search-for-an-integer-in-20-distinct-numbers-the-program-should-return-the-location-of-an-element-ignou-bca-assignment-2015-16
(b) Write a recursive program to calculate the factorial of a given number. 8
Solved program can be found on this link http://cssimplified.com/c-programming/draw-a-corresponding-flow-chart-to-find-the-factorial-of-a-given-number-using-recursion-10m-dec2008
(c) Give an example to explain null pointer assignment. 4
Solved program can be found on this link http://cssimplified.com/c-programming/give-a-brief-note-on-null-pointer-assignment-write-a-program-to-illustrate-this-concept-6m-jun2008
3. (a) Write a program in C to find the multiplication of 2 matrices of size (3 x 3). 5
Solved program can be found on this link http://cssimplified.com/c-programming/an-interactive-c-program-to-multiply-two-matrices
(b) Write a macro for the following: 4×2=8
(i) to find largest number among 3 given numbers.
Solved program can be found on this link http://cssimplified.com/c-programming/write-a-macro-to-find-the-smallest-number-among-3-given-numbers-7m-jun2007