how java programming differ from pascal and C

how java programming differ from pascal and C

View Answers

December 30, 2008 at 3:26 AM

Hi friend,


C and Pascal are both arguably descendants of the ALGOL programming language series. ALGOL introduced so-called "structured programming", where programs were constructed of single entry-single exit "components" such as "if", "while", "for", "case", etc. Also, whereas before ALGOL only the expression syntax for languages was described systematically,


In Pascal, routines that return a value are called functions, and routines that don't return a value are called procedures. In C all routines are called functions, however routines that do not return a value are declared to return "void", meaning that they do not return anything. Actually "void" is not really a valid variable type, it can only be used when declaring the return type of a function. It cannot be used for declaring normal variables of this type,



The statements used between C and Pascal are roughly analogous. if (x) ... else ... while (x) ... do ... while (x) ... switch (x) { case a: ...; case b: ...; default: } if x then ... else ... while x do ... repeat ... until x case x of a: ...; b: ... end Pascal, in its original form, did not have an equivalent version of "default" case (this is a common extension). C has so called "early out" statements "break" and "continue". Pascal does not.


Using the preceeding rules, here is an example of a C function with no return value, and its Pascal equivalent procedure.
//1

void myProc( long myFirstParam, char mySecondParam )
{
/* Here we have some code that does something */
}

Now the Pascal version:

{ 10 }

procedure myProc(myFirstParam: LONGINT, mySecondParam: CHAR);
BEGIN
(* Here we have some code that does something *)
END;

Pascal returns its function values by assigning a value to the function name. C returns a value by using its return statement. Here is an example of a C function that takes no parameters and that returns a double precision floating point value, and then its Pascal equivalent:

/* 11 */

// C version

double myFunc(void){
return 3.14;
}

{12}

function myFunc : DOUBLE; (* Pascal Version *)
BEGIN
myFunc := 3.14
END;
-------------------------------------

Thanks









Related Tutorials/Questions & Answers:
how java programming differ from pascal and C - Java Beginners
how java programming differ from pascal and C  how Does the Java programming language differs from Procedural languages such as Pascal and C.when ýt... and Pascal are both arguably descendants of the ALGOL programming language series. ALGOL
Servlets differ from RMI
Servlets differ from RMI  Explain how servlets differ from RMI. Explain the advantages and disadvantages of each technology ?   RMI (Remote Method Invocation) are a means of client server communication
Advertisements
how to read from dictionary c
how to read from dictionary c  how to read elements from dictionary in c programming
How do I learn Java programming in one day from zero?
How do I learn Java programming in one day from zero?  Hi, I am.... Is there any way of really learning Java in one day? How do I learn Java programming in one day from zero? I am aware of C and C++ programming language. I have used
How do I learn Java programming in one day from zero?
How do I learn Java programming in one day from zero?  Hi, I am.... Is there any way of really learning Java in one day? How do I learn Java programming in one day from zero? I am aware of C and C++ programming language. I have used
C Programming
C Programming  hi,how can i write a program in C programming to place reservation in air plane from the menu let the user to inter his/her gender(W or M)and draw seats by using ascii codes and choose where he/she will sit
C Program to Print Pascal Triangle - Development process
C Program to Print Pascal Triangle  I want C Program to Print Pascal Triangle.  Hi Friend, Try the following code: #include #include void main(){ int a[15][15],i,j,rows,num=25,k; printf("\n enter
C Print Pascal Triangle
C Print Pascal Triangle In this section, you will learn how to display Pascal's triangle. A Pascal's triangle is a geometric arrangement of the binomial coefficients in a triangle.The rows of Pascal's triangle are conventionally
C++ programming language - Java Beginners
C++ programming language  int main() { int i = 1, c = 0, sum = 1,j ; scanf("%d", &j); while (i <= j) { sum = sum + (i /3+i/5); printf
c programming language - Java Beginners
c programming language  int main() { int i = 1, c = 0, sum = 1,j ; scanf("%d", &j); while (i <= j) { sum = sum + (i /3+i/5); printf("%d
c programming
c programming  how can i get the ouput in the format of a a b a b c
c programming
c programming  how can i get the ouput in the format of a a b a b c
c programming
c programming  how can i get the ouput in the format of a a b a b c
programming c#
programming c#   create and make use of at least one class with appropriate instance methods to solve the programming problem. use console-based menus to navigate between the functionality offered by the application. at least one
c programming
c programming  write a program to input five numbers by using while loop in c programing
C programming
C programming  i am beginner in C my text book says getchar() and putchar() reads single character at a time and print single character respectively...) { int c; while((c=getchar())!=EOF) { putchar(c); return 0; } i
c programming
c programming  Write a Program in 'C' to print the following output 'n' rows. for example, if n:3, the following should be output by the program : 1 1 2 L r 2 3 2 1 1 2 L 1
c programming
c programming  Write a Program in 'C' to print the following output 'n' rows. for example, if n:3, the following should be output by the program : 1 1 2 L r 2 3 2 1 1 2 L 1
Difference between C++ and Java
Java and C++ are Object Oriented Programming (OOPs) language. Java is derived from C++ , hence both has many similarities. C++ is considered more... programming and extends the C programming language. Java supports network computing
How to access data yearly from DB in C# ?
How to access data yearly from DB in C# ?  how to access data yearly from database in C#. I have code but i m not able to retrieve data yearly from... as Student_ID,payment FROM fee" + ses + " where date1='" + date1
C/C++ Programming Books
C/C++ Programming Books      ... for Visual C++ 6 programming. This book skips the beginning level material and jumps....     C++ GUI Programming
Java vs C
Java vs. C Language In this section we will compare Java and C Programming... business problem. Java is object oriented, platform independent programming language... programming language while c is procedural language Platform independence
C Programming SubString Program
C Programming SubString Program  Sir I want to Check whether the Single Substring is present in the given 3 string. characters. eg if i entered First String- CPROGRAMMING Second String- CPROGRAM third String- PROGRAMMING if i
how to read 100 text files from a folder or directory and write the data into a single file.using java programming?
how to read 100 text files from a folder or directory and write the data into a single file.using java programming?  i have multiple(app..100) text... column value that keeps on changing for every file.i have read the data from all
hi need help with C++ programming!
hi need help with C++ programming!  how do i : b. Store numbers / characters into the file (output) c. Retrieve numbers / characters from the file...; "Unable to open file"; return 0; } c) #include <iostream> #include <
c programming - Development process
c programming  Hello Sir, can you plz post an answer to these quesions : Write a program in c that prompts the user the name of a file... in c to create a fle, open it, type in some characters and count the number
pascal triangle
the following link:ADS_TO_REPLACE_1 C Pascal's Triangle Thanks...pascal triangle   given string : char str[]="123456789"; write a program in 'c'-language that displays the following: 1 232
How a beginner can start Java Programming?
How a beginner can start Java Programming?  I Just have programming knowledge of C & C++. Let's know how I can learn Java? Is there any Java... have programming language of C and C++ then you can learn Java programming
Learning Java Programming for Beginners
Java is an Object Oriented Programming Language that was developed by Sun Microsystems. It is based on C, C++ programming language but a tad better.... There are several ways by which a young developer can learn Java programming, one
How to learn Java programming in a month
How to learn Java programming in a month  Hi, I just completed my graduation and want to learn Java for making career in software development. How...   Hello, How to learn Java programming in a month? It's a hard
How to learn Java programming in a week?
How to learn Java programming in a week?  Hi, I am in hurry to find job and want to learn Java quickly. I think after learning basics of Java I... to learn Java programming in a week? Thanks
ModuleNotFoundError: No module named 'differ'
'differ' How to remove the ModuleNotFoundError: No module named 'differ'...ModuleNotFoundError: No module named 'differ'  Hi, My Python... to install padas library. You can install differ python with following command
programming language definition you can learn apart from java
programming language definition you can learn apart from java  Hi, I am learning Java to make an entry into the programming field. I just wanted... to learn and use the Java programming language. So, these websites are best place
ModuleNotFoundError: No module named 'pascal'
'pascal' How to remove the ModuleNotFoundError: No module named 'pascal'...ModuleNotFoundError: No module named 'pascal'  Hi, My Python... to install padas library. You can install pascal python with following command
how to use marathi keyboard in java programming?
how to use marathi keyboard in java programming?  how to use Marathi keyboard in java programming
How to write in Binary file in Java programming language
How to write in Binary file in Java programming language  I need some help about Java programming. Please explain me "How to write in Binary file in Java programming language
c programming..what wil be the output of this program
c programming..what wil be the output of this program   #include int main() { int arr[] = {0,1,2,3,4}; int i,*ptr; for (ptr=arr+4; ptr= arr; ptr--) { printf("%d",*ptr
Java Programming
Java Programming  Hi, What is Java Programming? How I can learn Java Programming in one month? Thanks
how to convert Visual c++ to java - Java Beginners
how to convert Visual c++ to java  Hi Sakthi here.. How to convert Visual c++ codings to Java codings.. Does both have any similarity in library files
Ask make graph from i report and view to java Language Programming
Ask make graph from i report and view to java Language Programming  Dear sir, Please help me, i want to make a graph from mysql to i report and view to java. Please help me, give me example source code please. thank you
ModuleNotFoundError: No module named 'osa_differ'
'osa_differ' How to remove the ModuleNotFoundError: No module named 'osa_differ' error? Thanks   Hi, In your python environment you...ModuleNotFoundError: No module named 'osa_differ'  Hi, My Python
ModuleNotFoundError: No module named 'rpc-differ'
'rpc-differ' How to remove the ModuleNotFoundError: No module named 'rpc-differ' error? Thanks   Hi, In your python environment you...ModuleNotFoundError: No module named 'rpc-differ'  Hi, My Python
How to create dynamic array in C?
How to create dynamic array in C?  How to create dynamic array in c programming language?   Dynamic Array in C Tutorial
How to learn Java with no programming experience
. Apart from these, topic How to learn Java with no programming experience...Tutorial, how to learn Java provides you the opportunity to you about... programming landscape, which provides you diverse functionalities. Learning Java
How to learn Java with no programming experience?
How to guide for learning Java with no programming experience? Yes, with your... programming index page How to Get Started with Java... programming. ADS_TO_REPLACE_2 Learning Java First of all understand the basics
How to download java software for Java Programming
How to download java software for Java Programming  Hi, How to download java software for Java Programming? I have purchased a computer.... Please see the thread How to download Java. Thanks
ModuleNotFoundError: No module named 'pascal-tokenizer'
named 'pascal-tokenizer' How to remove the ModuleNotFoundError: No module named 'pascal-tokenizer' error? Thanks   Hi, In your...ModuleNotFoundError: No module named 'pascal-tokenizer'  Hi, My
ModuleNotFoundError: No module named 'pascal-tools'
'pascal-tools' How to remove the ModuleNotFoundError: No module named 'pascal-tools' error? Thanks   Hi, In your python...ModuleNotFoundError: No module named 'pascal-tools'  Hi, My Python
ModuleNotFoundError: No module named 'Pascal_Triangle'
named 'Pascal_Triangle' How to remove the ModuleNotFoundError: No module named 'Pascal_Triangle' error? Thanks   Hi, In your python...ModuleNotFoundError: No module named 'Pascal_Triangle'  Hi, My
ModuleNotFoundError: No module named 'pascal-tokenizer'
named 'pascal-tokenizer' How to remove the ModuleNotFoundError: No module named 'pascal-tokenizer' error? Thanks   Hi, In your...ModuleNotFoundError: No module named 'pascal-tokenizer'  Hi, My

Ads