Skip to main content

Why C is a Middle Level Language?

Students who are in computer field will be aware about this topic . . . But do you really know why C is known as "Middle Level Language"?

In this article I will tell you some essential points, which makes you more prudent . . .Here, two cases are taken for discussion and that are: Function and Array

Functions of C language

  1. C doesn't back up Pascal like procedures - the original C always had a return value (void was later added during standardization; it means the value is returned from a function but that value is ignored)
  2. The arguments that you pass to the function is stored first onto the stack in the reverse order - before function is called. Now, when the function is called, it takes the arguments one by one (Last In first Out). For example, you have three variables such as 10, 20, and 30 to pass to the function. In stack, 30 will be the first element which will be stored, 20 second and so on. Now, when function will try to retrieve the elements from stack, the first element will be 10, 20 and 30.
  3. C doesn't back up for nested functions (Function inside the function)
  4. When function names are used in C, they decay into pointers. In other words, the name of the function is best thought of as an address, usually in a code segment, where that functio's executable code is stored.

Arrays of C language

  1. Array is a collection of same type of elements.
  2. With the aid of array's first address, you can access further elements one by one. So, you need to recollect only the first element address.
  3. The array elements are stored in a contiguous manner. It means there is no gap between any elements.
  4. You can access the element in many ways, like arry[i], i[arry], i + arry, and arry + i. This facility is provided by pointer.
  5. Array indexing starts from 0, not 1.
Still the features of arrays and functions look very high-level, familiar to us, and easy to use. That is the beauty of C and that is the reason why C is related to as middle level programming.

Comments

Popular posts from this blog

Characteristics of a Good Programming Language

Till now there are many high level languages which are very popular, and there are others, which could not become so popular in-spite of being very powerful. There might be many reasons for the success of a language, but one obvious reason is the characteristics of the language. Several characteristics believed to be important with respect to making a programming language good are briefly discussed below. Simplicity A good programming language must be simple and easy to learn and use. For example, BASIC is liked by many programmers only because of its simplicity. Thus, a good programming language should provide a programmer with a clear, simple and unified set of concepts which can be easily grasped. It is also easy to develop and implement a compiler or an interpreter for a programming language that is simple. However, the power needed for the language should not be sacrificed for simplicity. The overall simplicity of a programming language strongly affects the readability of the pr...

Angular 4 and Firebase Authentication: Setup

If you have come to this article, it means you are keen to learn new technology and that too Firebase. I love Firebase because it provides all basic but important features of any web application. Take for example, authentication, which is cumbersome and risky if not implemented with utmost care. And when we have the integration of Angular and Firebase, it becomes a lot easier for a developer to build such crucial modules in less time with minimal efforts. In this article we will create a simple Angular application using Firebase. I am going ahead with the understanding that you know the benefits of Firebase and have little knowledge about it. There are plenty of posts out on the web if you are behind. Step 1: Install Angular CLI (if not installed). npm install -g angular-cli Step 2: Create new Angular 4 project. By default now angular CLI will create Angular 4 project so you need not fret. ng new firebase-authentication Step 3: Check whether the ne...

Switch-case, simple calculator . . .

11.      Write a program to perform some mathematic functions with the help of “switch-case” statement. #include<stdio.h> #include<conio.h> void main() { int a,b,ans; char c; clrscr(); printf("\ Enter a and b:"); scanf("%d%d",&a,&b); printf("\n Enter operator:"); fflush(stdin); scanf("%c",&c); switch(c) { case'+':ans=a+b;       break; case'-':ans=a-b;       break; case'*':ans=a*b;       break; case'/':ans=a/b;       break; } printf("\n ans %d",ans); getch(); } 12.      Print the Fibonacci series #include<stdio.h> #include<conio.h> void main() { int a=1,b=1,s=3,c,ch; clrscr(); printf("how many steps="); scanf("%d",&ch); printf("%5d%5d",a,b); for(s=3;s<=ch;s++) {       c=a+b;       printf("%5d",c);       a=b;    ...