Skip to main content

Features of C

Features of C

a) Middle Level Language : C is a middle level language as it combines elements of high-level language with the functionals of assembly language.C allows manipulation of bits, bytes and addresses - the basic elements with which the computer functions. Also, C code is very portable, that is software written on one type of computer can be adapted to work on another type. Although C has five basic built-in data types, it is not strongly typed language as compared to high level languages, C permits almost all data type conversions.
It allows direct manipulation of bits, bytes, words, and pointers.

b) Block Structured Language : C is referred as a structured language because it is similar in many ways to other structured languages like ALGOL, Pascal and the likes.

C allows compartmentalisation of code and data. This is a distinguishing feature of any structured language. It refers to the ability of a language to section off and hide all information and instructions necessary to perform a specific task from the rest of the program. Code can be compartmentalised in C using functions or code blocks. Functions are used to define and code separately, special tasks required in a program. This allows programs to be modular. Code block is a logically connected group of program statements that is treated like a unit. A code block is created by placing a sequence of statements between opening and closing curly braces.


c) Code Portability:
The code written in c is machine independent which means, there is no change in ‘C’ instructions, when you change the Operating System or Hardware. There is hardly any change required to compile when you move the program from one environment to another.


d) Recursion:
A function may call itself again and again.this feature is called as recursion,is supported by C.

Comments

Popular posts from this blog

Turbo C++ for Windows 7 64 bit

 Its a very simple guide to install Turbo C++ on Windows 7 64 bit  operating system. Follow the steps below to install Turbo C++ compiler on your windows 7 ,64 bit operating system. Note - Please let me know whether the process is working for you or if you are getting some kind of error. Step 1) Install the software DOSBOX version 0.73(Search for it in the search bar). Step 2) Create a folder on your C drive, e.g.Turbo; (c:\Turbo\) Step 3) Extract TC into the created folder(e.g. c:\Turbo\);(you can search and download it) Step 4) Run the application DOSBOX 0.73,previously downloaded and installed. Step 5) Type the following commands at the command prompt that will appear, [z]: mount d c:\Turbo\ Following this you will get a message "Drive D is mounted as local directory c:\Turbo\" Step 6) Type d: to shift to d: Step 7) Then type commands mentioned below; cd tc cd bin tc or tc.exe Step 8) In the turbo C++ go to Options\Directories\ Chang

Calculating the average of two numbers using C++

Though this site aims at understanding C language, I am writing a program for you in C++, to have a general idea about C++ too. A program in C++,to calculate the average of two numbers, which are entered by the keyboard while the execution of the program. Try to understand the program; #include &lt iostream &gt using namespace std; int main() {     float num1,num2,average,sum;     cout << "Enter the first number:";     cin >> num1;     cout << "Enter the second number:";     cin >> num2;     sum=num1+num2;     average=sum/2;     cout << "The sum of the two numbers is:"<< sum<<"\n"<<"The average of the two numbers is:" << average; return(0); } Explaination: The new file header used here in this C++ program is the #include . By this , we are asking the preprocessor to add the contents of the iostream file to our program. The program is written in the

Finding the arithmetic operators

Below is a very simple program to find the arithmetic operator. Please feel free to put a comment if need an explanation. #include #include void main()   {     float a1,a2;     char operator;     printf("\n Enter the values of a1 operator a2\n");     scanf("%f%c%f",&a1,&operator,&a2);     switch(operator)      { case '+': printf("%.2f",a1+a2); break; case '-':  printf("%.2f",a1-a2);  break; case '*':  printf("%.2f",a1*a2); break; case '/':  if(a2==0)  printf("error\n");  else  printf("%.2f",a1/a2);  break; default: printf("unknown operatotr\n"); break;      }    }