Saturday 6 June 2015

Difference between C, JAVA and Pascal


Java
java is a general-purpose computer programming language that is concurrent, class based, object oriented, and specifically designed to have as few implementation dependencies as possible. One design goal of Java is portability, which means that programs written for the Java platform must run similarly on any combination of hardware and operating system with adequate run time support.
Pascal
Pascal is a historically influential imperative and procedural programming language, designed in 1968–1969 and published in 1970 by Niklaus Wirth as a small and efficient language intended to encourage good programming practices using structured programming and data structuring.
C
C is a general-purpose, imperative computer programming language. It supports structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations. By design, C provides constructs that map efficiently to typical machine instructions, and therefore it has found lasting use in applications that had formerly been coded in assembly language, including operating systems, as well as various application software for computers ranging from supercomputers to embedded systems.
Difference
Description
C
Java
Pascal
               Comments
/* comment */
// is used for comments
{ comment }
            for loop
For (int 1=10;i<=10;i++)
For (int 1=10;i<=10;i++)
for i := 1 to 10 do statement
               operators
%
/
%
/
mod
div
          Declaration
(Integer declaration)
inti,j,k;

(Array declaration)

sInt A[10];

(Integer declaration)
inti,j,k;

(Array declaration)

int[] A = new int[10];
orint A[] = new int[10];
(Integer declaration) i,j,k:integer

(Array declaration)

A:array[0..9] of integer
          Functions
char a (int b)
{
...
return 'X';
}
char a (int b)
 {
...
return 'X';
}
function a(b:integer):char
begin
...
a:='X'
end;
               Reverse for loop
for (int i=10; i>0; i--)
statement
for (int i=10; i>0; i--)
statement
for i := 10 downto 1 do
statement

No comments:

Post a Comment