25 November 2010

Program To Implement Binary Search Tree.

Program To Implement Binary Search Tree.

24 November 2010

C programming language - Definition



For the "PHP" Cold War history project, see Parallel History Project.

PHP (a recursive acronym for "PHP: Hypertext Preprocessor"; actually a retronym (see history)) is a widely-used open-source programming language primarily for server-side applications and developing dynamic web content.

Famous examples of PHP applications include phpBB and MediaWiki, the software behind Wikipedia. The PHP model can be seen as an alternative to Microsoft's ASP/VBScript/JScript system, Macromedia's ColdFusion system, Sun Microsystems' JSP/Java system, and to the CGI/Perl system.



Code example

Here is the Hello World code example:





echo "Hello, world!\n";

?>



Here is an example that prints out the lyrics for the song 99 Bottles of Beer:





/*

* /* ... */ is a comment that can span one or many lines.

* Other ways of commenting are // and # symbols.

* This kind of comment does not need stars (*) in the beginning of each line,

* but including them is a common practice. // and # are also comments.

* They only comment the text that are after them in the same line. They have

* no special ending character.

*

*/



/*

* First we define a new function called "plural".

* It will return an "s" if the argument passed to it was any other

* than number 1.

*/



function plural($number) {

return ($number != 1 ? "s" : "");

// The ternary ?: operator is similar to if-else: (test_condition ? true : false)

// In this case it's used to return "" for one and "s" for all other numbers

}



// We define a variable called $lb to contain an HTML line break

// as well as a carriage return and line feed:

$lb = "
\r\n";



for ($i = 99; $i > 0; $i--) {

echo $i . " bottle" . plural($i) . " of beer on the wall," . $lb;

// We don't actually need a new echo for each line. Let's see:

echo $i . " bottle" . plural($i) . " of beer." . $lb . "

Take one down, pass it around," . $lb .

($i - 1 != 0 ? $i - 1 : "no more") .

" bottle" . plural($i - 1) . " of beer on the wall" . $lb . $lb;

}



echo "Go to the store," . $lb . "buy some more," . $lb .

"99 bottles of beer on the wall!";



?>



Notes:

PHP allows the placement of strings on multiple lines, as long as it eventually finds a semicolon (;) to terminate it.

A period (.) concatenates strings together.

Variables always have names that start with a dollar sign ($), and are parsed inside double quotation marks ("), but not inside single quotation marks ('). Functions, such as plural(), are never parsed inside any sort of string.

Although PHP allows both # and // for "same line" comments, it is generally preferred to use the C-style // and not the Perl-style #.

For output, this program uses echo.





C Plus Plus - Definition



The title given to this article is incorrect due to technical limitations. The correct title is C++.

C++ (pronounced "see plus plus") is a general-purpose computer programming language. It is a statically typed free-form multi-paradigm language supporting procedural programming, data abstraction, object-oriented programming, and generic programming. During the 1990s, C++ became one of the most popular commercial programming languages.

Bell Labs' Bjarne Stroustrup developed C++ (originally named "C with Classes") during the 1980s as an enhancement to the C programming language. Enhancements started with the addition of classes, followed by, among many features, virtual functions, operator overloading, multiple inheritance, templates, and exception handling. The C++ programming language standard was ratified in 1998 as ISO/IEC 14882:1998, the current version of which is the 2003 version, ISO/IEC 14882:2003.

In C and C++, the expression x++ increases the value of x by 1. The name "C++" is a play on this, suggesting an improvement upon C.





COBOL - Definition



COBOL is a third-generation programming language. Its name is an acronym, for COmmon Business Oriented Language, defining its primary domain in business, finance, and administrative systems for companies and governments.

The COBOL 2002 standard includes support for object-oriented programming and other modern language features. However, most of this article is based on COBOL 85.