Home Answers Viewqa Java-Beginners how java programming differ from pascal and C

 
 


stan
how java programming differ from pascal and C
1 Answer(s)      4 years and 5 months ago
Posted in : Java Beginners

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 Pages:
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
C and C++ books-page10
C++ Programming is being used in a wide variety of classrooms, from...; The programming language C As a programming language, C is rather... offers an introduction to the C++ programming language. It is a guide for C/C
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
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++Tutorials
++ is a programming language substantially different from C. Many see C++ as "a better C than... language from the start.The C programming language was developed at Bell Labs during...++ Programming Language Tutorial C++NPv1 describes how middleware and the ACE
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
pascal triangle
the following link: C Pascal's Triangle Thanks...pascal triangle   given string : char str[]="123456789"; write a program in 'c'-language that displays the following: 1 232
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
Programming
Programming  how to save output of java file in .txt format?   Hi, If you are running the example from dos prompt you can use the > bracket to direct the output to a text file. Here is the example: C:>java
how to read from dictionary c
how to read from dictionary c  how to read elements from dictionary in c programming
Java vs. C
, cheaper, ...) to produce good programs. From C++ to Java If you know C or C..., the primitive types, operators, and statements of Java are taken directly from C... the basis for Object Oriented Programming (OOP). Java classes are like C++ class
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
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 Tutorials
; C get Substring from String This section illustrates you how to get... to illustrates you how to convert temperature from Celsius to Fahrenheit in C... will learn how to determine the length of a String in C. You can see in the given
Objective C
; Objective C is a programming language, which is sleeted by Apple for developing... Objective C tutorials. We will be explaining the programming language with easy... you the basic introduction about Objective C programming language. Objective
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 9.3 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook...: M 1000 X 10 D 500 V 5 C
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
Java Programming: Section 2.4
facilities, and it requires some advanced Java programming skills to use.... For those of you familiar with the C programming language, System.out.printf... this means depends on the Java programming environment that you are using
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 5.1 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... The versions of the PairOfDice class in Section 2 differ in how the dice
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 8.1 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... in red are the ones that differ significantly from the original program
The continue statement The continue statement is used in many programming languages such as C
in many programming languages such as C, C++, java etc. Sometimes we do not need...; C:\chandan>javac Continue.java C:\chandan>java Continue chandan...The continue statement The continue statement is used in many programming
Java Programming, Solution to Programming Exercise
POSSIBLE SOLUTION to the following exercise from this on-line Java textbook.... Some languages use predicates in generic programming. Java doesn't, but this exercise looks at how predicates might work in Java. In Java, we could use
Java Programming: Section 6.3
ON A COMPUTER SCREEN has to be drawn there, even the text. The Java API includes... buttons, menus, text-input boxes, scroll bars, check boxes, and so on. In Java... surface, so programming a JApplet that does custom drawing will always involve
Java Programming: Section 10.4
not quite as easy to work with as files are. But in Java, you can do network.... One of the standard Java packages is called java.net. This package includes..., one on each of the computers involved in the communication. Java uses a class
Java Programming: Section 7.2
, and I have used it on exactly two occasions in my own Java programming career... reference. CardLayout CardLayouts differ from other layout managers... that can be used as containers. This leads to two questions: How are components
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 8.5 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook.... Your applet will be simpler than the Checkers applet from Section 8.5. Play
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 and C++ books-page2
.    The C Programming Language  Here are some... debugging Pascal to an advanced first-year programming class a couple of years... C and C++ books-page2      
C and C++ books-page8
; The ODBC from C Tutorial  In this section for example-based C tutorials that introduce you to ODBC API programming in C. Each tutorial contains... from UNIX. The ODBC Application Programming Interface (API) defines
C++GraphicsTutorials
C++ Graphics Tutorials             Game programming with DirectX... from use or misuse of either this document or any of the files available
Java Programming
¢â??¢s programming mark. Determine how many student get A+ and A for their grade and how many students get D and E based on the following table: Mark Grade 85...Java Programming  Write a Java program that prompt user to input
programming error - Java Beginners
programming error  import java.io.*; import javax.servlet.*; import..."); PrintWriter out=res.getWriter(); //String C=req.getParameterValues("C1"); try... state=s.executeQuery("select * from PlaceAd"); out.println(""); out.println
Hibernate vs JDBC
This section is better understanding of how hibernate is differ from JDBC
programming
Java Constructor programming for single and double constructor  write a program which have no argument constructor ,single parameter constructor... of in this constructor he we tell the how much object we created in the no argument.single
Introduction
languages  like C, C++  and java are case sensitive languages while...;  The Java class Helloworld is a completely different class from the class... be differ in meaning based on different use of uppercase and lowercase letters
java programming
java programming  Hi, now am analysing one project from that project... outp = 0; for(int i = 0; i < FCM.points; i++) { for(int c = 0; c <Clusters; c++) { outp += FCM.Group_Cluster[c][i
java programming
programming mark. Determine how many student get A+ and A for their grade and how many...java programming  Write a Java program that prompt user to input... A 75 - 79 B+ 70 - 74 B 65 - 69 B- 60 - 64 C+ 55 â?? 59 C 50 - 54 C- 45 - 49 D
Java Programming
Java Programming  Assume that bank maintains two kinds of accounts... that stores Customer name, account number and type of account. From this derive.... a. Accept deposit from a customer and update the balance. b. Display
cmd in c++/JAVA - Java Beginners
cmd in c++/JAVA  HI , CAN U TELL ME THAT HOW I CAN MAKE THE COMMAND FOR DOS IN C++ OR JAVA....? eg.:-COPY,COPYCON,DELETE,FORMAT,DATE ETC. PLZ TELL ME WHERE I CAN LEARN THE SYSTEM PROGRAMMING ,AND DOS GAMES ETC. PLEASE
C and C++ books-page12
to give you a general overview of the C programming language. Although much.... C has been used successfully for every type of programming problem... like Pascal or C which use object-oriented concepts. But there exist a few
Java programming
". This is how I need to find that percentage - by the endings of words. The text is from...Java programming  Hello! Is anybody able to do this task: I need to find the percentage of words distribution between parts of speech. I have to mark
Java Programming: Section 1.3
of a computer. Almost all programs, though, are written in high-level programming languages such as Java, Pascal, or C++. A program written in a high-level language... Section 1.3 The Java Virtual Machine MACHINE LANGUAGE CONSISTS
java programming
java programming  WAP to find the longest word from a user given string.   The given code finds the longest word from the string. import...(); } }   how can we write the above program by separating each word
programming
Java no argument constructor programming  write a program which have no argument constructor ,single parameter constructor constructor,double... tell the how much object we created in the no argument.single or double parameter
programming
Java single parameter constructor  write a program which have no argument constructor ,single parameter constructor constructor,double parameter... the how much object we created in the no argument.single or double parameter
programming
Java parameter constructor  write a program which have no argument constructor ,single parameter constructor constructor,double parameter constor,and the now when we create a object of in this constructor he we tell the how much
programming
Constructor in java application  write a program which have no argument constructor ,single parameter constructor constructor,double parameter constor,and the now when we create a object of in this constructor he we tell the how
programming
Constructing a constructor in java application  write a program which have no argument constructor ,single parameter constructor constructor,double... we tell the how much object we created in the no argument.single or double
programming
constructor object in java application programming  write a program which have no argument constructor ,single parameter constructor constructor... he we tell the how much object we created in the no argument.single or double

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.