Difference Between


(1) Compiler and Interpreter

Compiler Interpreter
Compiler scan whole program for syntax error. If a program contains syntax error than it display list of syntax errors otherwise it will translate source code of a program in to intermidiate object code.
Interpreter scan only single statement at a time for syntax error. If a statement contains syntax error than it display error otherwise it will translate source code of a statement into object code.
Example: C, C++ Example: Basic,Pythone, Ruby
It require more memory because of intermidiate object code.
It require less memory because no intermidiate object code is generated.
Overall execution time of a program is faster as compared to interpreter.
Overall execution time of a program is slower as compared to compiler.
It takes large amount of time to analyze the program because it scan entire program at a time.
It takes less amount of time to analyze the program because it scan only single statement at a time.

     

(2) Flowchart and Algorithm

Flowchart Algorithm
Graphical representation of an algorithm is known as flowchart.
An algorithm is a set of instruction that leads to a solution. It is a step by step solution of particular problem.
Preparing Flowchart for complex problem is very difficult.
Preparing Algorithm for complex problem is not difficult.
Reproduction of Flowchart is very difficult as compared to Algorithm.
Reproduction of Algorithm is very easy as compared to flowchart.
A problem can be easily understand using Flowchart as compared to algorithm.
A problem cannot be easily understand using Algorithm as compared to Flowchart.

(3) High Level Language and Low Level Language

High Level Language Low Level Language
The language that is written using English statements is known as higher level programming languages.
The language that is written using binary digits 0 and 1 is called Machine language or Low level programming language.
It can be easily understand by user.
It is very difficult for user to understand Low Level Language.
Executes slower as compared to Low Level Language.
Executes faster as compared to High Level Language.
It require translator to translate High Level Language code into Low Level Language code before execution.
It does not require translator because Low Level Language code is directly executed by machine..

(4) Variable and Constant

Variable Constant
Variable is a named location in computer's memory.
Constant means fixed value.
Value of the variable may change during execution of the program.
Value of the constant cannot change during execution of the program.
It is compulsory to specify data type of the variable at the time of its declaration.
It is not compulsory to specify data type of the constant at the time of its declaration.
It is not necessary to assign value at the time of its declaration.
It is compulsory to assign value at the time of its declaration.

(5) While Loop and Do While Loop

While Loop Do While Loop
In while loop, condition is checked at the beginning of loop.
In do...while loop, condition is checked at the end of loop.
It is known as entry controlled loop.
It is known as exit controlled loop.
If condition is false at the first trial body of the loop never executes.
If condition is false at the first trial body of the loop executes at least once.
Syntax:
while(condition)
{
Body of loop
}
Syntax:
do
{
Body of loop
} while(condition);

(6) Break and Continue

Break Continue
Break statement is used to transfer control of the program immediately after the loop or switch case statement.
Continue statement is used to skip some part of the loop and transfer control of the program to the next iteration in the loop.

(7) Keyword and Identifier

Keyword Identifier
Keywords are predefined words.
Identifiers are user defined words.
Keywords can not be used as a name of variable, constant , array, function etc..
Identifiers can be used as a name of variable, constant , array, function etc..
Example:
int, float, while, for etc...
Example:
total, marks, roll_no etc...

(8) User Define Function and Built In Function

User Define Function Built In Function
User Defined functions are defined by the user as per their requirements.
Built in functions are pre defined inside standard library files. For example printf () and scanf () functions are predefined in stdio.h library file. So they are known as Built in functions.
User has to declare and define User defined function in the program before calling it.
There is no need to declare and define Built in function in the program before calling it.

(9) Call By Value and Call By Reference

Call By Value Call By Reference
In this method of calling the function values of the original variables is passed to the function.
In this method of calling the function addresses of the original variables is passed to the function using concept of pointer.
As you pass the values of original variables it is copied in the formal parameters of the function. Thus function works with the copy of the original variables. Any changes that are made to the variables inside function do not affect the original variables.
As you pass the addresses of original variables, the function works with the original variables. Any changes that are made to the variables inside function also affect the original variables.
Call by value method can not alter the value of the original variable.
Call by reference method alters the value of the original variable.

(10) Structure and Union

Structure Union
Compiler allocates separate memory for each member of the structure.
Compiler allocates common memory space for all members of union such that it can accommodate largest member of the union.
Occupies more memory as compared to union.
Occupies less memory as compared to structure.
Hence all the member having separate memory allocation we can use all the structure members at same time.
Hence all the members having common memory allocation we can use only one member of union at same time.

(11) Array and Structure

Array Structure
Array is a collection of variables of same data type.
Structure is a collection of variables of different data type.
Individual element of an array can be accessed using array name along with index.
Member of a structure can be accessed using structure variable followed by dot operator followed by member name.

(12) Type Conversion and Type Casting

Type Conversion Type Casting
It is performed by compiler.
It is performed by user.
It is also known as Implicit type conversion.
It is also known as Explicit type conversion.
It is performed automatically when: (1) Value of one type is assigned to a variable of different type. (2) While evaluating expression that contains variable of different type.
It is performed explicitly by user when user wants to convert variable of one type to another type.

(13) Local Variable and Global Variable

Local Variable Global Variable
Local variables are declared inside function.
Global variables are declared outside all the functions.
Local variables can be accessed only in the function in which they are declared.
Global variables can be accessed by all the function of the program.
Local variable retain its value as long as function is in execution.
Global variable retain its value as long as program is in execution.

Widget is loading comments...

Download Projects


Download Programs