COBOL is one of the oldest programming languages. Its name is an acronym for COmmon Business-Oriented Language, defining its primary domain in business, finance, and administrative systems for companies and governments. COBOL programs are in use globally in governmental and military agencies and in commercial enterprises, and are running on operating systems such as IBM's z/OS and z/VSE, the POSIXfamilies (Unix/Linux etc.), and Microsoft's Windows as well as ICL's VME operating system and Unisys' OS 2200. In 1997, the Gartner Group reported that 80% of the world's business ran on COBOL with over 200 billion lines of code in existence and with an estimated 5 billion lines of new code annually.

The equivalent construct in many procedural languages would be age = age + years This syntax is similar to the compound assignment operator later adopted by C: age += years The abbreviated conditional expression IF SALARY > 8000 OR SUPERVISOR-SALARY OR = PREV-SALARY is equivalent to IF SALARY > 8000 OR SALARY > SUPERVISOR-SALARY OR SALARY = PREV-SALARY

Hello, world
An example of the "Hello, world" program in COBOL: IDENTIFICATION DIVISION. PROGRAM-ID. HELLO-WORLD. PROCEDURE DIVISION. DISPLAY 'Hello, world'. STOP RUN. Like any widespread programming language, there are various dialects of COBOL. Some compilers, for example, allow the use of double quotes in addition to standard single quotes: DISPLAY "Hello, world".

points < 0.'(a.g12. average_points write (*. it keeps this example simple implicit none real. allocatable :: points integer real negative_average=0..g12.) end if if (count(points < 0.) / count(points > 0.) > 0) then positive_average = sum(points. positive_average=0. write (*. positive_average write (*.) > 0) then negative_average = sum(points. imperative programming language that is especially suited to numeric computation and scientific computing.g12.*) points ! Take the average by summing points and dividing by number_of_points if (number_of_points > 0) average_points = sum(points) / number_of_points ! Now form average over positive and negative points only if (count(points > 0. finite element analysis.*) "Enter the points to average:" read (*.*) number_of_points allocate (points(number_of_points)) write (*. points > 0.*) "Input number of points to average:" read (*. dimension(:). if there are no data points. computational fluid dynamics. It is one of the most popular languages in the area of high-performance computing and is the language used for programs that benchmark and rank the world's fastest supercomputers. negative_average end program average .. Originally developed by IBM at their campus in south San Jose. Fortran came to dominate this area of programming early on and has been in continual use for over half a century in computationally intensive areas such as numerical weather prediction. computational physics and computational chemistry.) end if deallocate (points) ! Print result to terminal write (*. California in the 1950s for scientific and engineering applications.'(a. an average of zero is returned ! While this may not be desired behavior. ! As written.4)') 'Average of positive points = '.program average ! Read in some numbers and take the average FORTRAN PROGRAMMING LANGUAGE Fortran (previously FORTRAN) is a generalpurpose.4)') 'Average = '.) / count(points < 0.'(a.4)') 'Average of negative points = '. :: number_of_points :: average_points=0.

scanf("%d". Go.. C++ started as a preprocessor for C and is currently nearly a superset of C. . return 0. C (/ˈsiː/. a).. Python. } The correct usage would be: scanf("%s". like the letter C) is a general-purpose programming language initially developed by Dennis Ritchie between 1969 and 1973 atBell Labs. Perl. D. JavaScript. } If you compile and run this program. int main(void) { printf("Hello..h" int main(void) { int a. and therefore it found lasting use in applications that had formerly been coded in assembly language. world!\n"). and they tend to combine the recognizable expression and statementsyntax of C with underlying type systems and data models that can be radically different.Recall from the beginning of this text the demonstration program duplicated below: #include <stdio. and Unix's C Shell. it will show: This sentence will print out exactly as you see it. Its design provides constructs that map efficiently to typical machine instructions. C is one of the most widely used programming languages of all time. printf("Please input an integer value: "). a). including: C#. you will see the sentence below show up on your screen: Hello. The most pervasive influence on these languages has been syntactical. LPC.. Limbo. printf("You entered: %d\n". And once it is contained in a proper main() function. Java.h> C PROGRAMMING LANGUAGE In computing. Many later languages have borrowed directly or indirectly from C. world! A typical application might be like this: #include "stdio. printf("This sentence will print out exactly as you see it. PHP. &a). and there are very few computer architectures for which a C compiler does not exist."). return 0. most notably system software like the Unix computer operating system.

NET Framework used Visual Basic . 10 INPUT "What is your name: ". A$ 100 IF LEN(A$) = 0 THEN GOTO 90 110 A$ = LEFT$(A$. high-level programming languages whose design philosophy emphasizes ease of use. and often part of the firmware of the machine. At the time.NET as their only programming language.USA to provide computer access to non-science students. BASIC remains popular in numerous dialects and new languages influenced by BASIC such as Microsoft Visual Basic. the name is an acronymfrom Beginner's All-purpose Symbolic Instruction Code. when it was typically a standard feature. In 2006. which was something only scientists and mathematicians tended to do. U$ 140 END The resulting dialog might resemble: What is your name: Mike Hello Mike How many stars do you want: 7 ******* Do you want more stars? yes How many stars do you want: 3 *** Do you want more stars? no Goodbye Mike . U$ 20 PRINT "Hello ". N 40 S$ = "" 50 FOR I = 1 TO N 60 S$ = S$ + "*" 70 NEXT I 80 PRINT S$ 90 INPUT "Do you want more stars? ". The original Dartmouth BASIC was designed in 1964 by John George Kemeny and Thomas Eugene Kurtz at Dartmouth College in New Hampshire. 59% of developers for the . 1) 120 IF A$ = "Y" OR A$ = "y" THEN GOTO 30 130 PRINT "Goodbye ".Sample BASIC PROGRAMMING LANGUAGE BASIC is a family of general-purpose. nearly all use of computers required writing custom software. The language and its variants became widespread on microcomputers in the late 1970s and 1980s. U$ 30 INPUT "How many stars do you want: ".

end find_strings. Search for a string /* Read in a line. do while (end_file = 0). pattern) > 0 then put skip list (line_no. Hello world program Hello2: proc options(main). point. which contains a string. end. business and systems programming applications. fixed-point. PL/I's principal domains are data processing. complex. line_no = line_no + 1.structured programming. end_file) fixed binary. it supports recursion. and continues to be actively used as of 2011. declare line character (100) varying. */ find_strings: procedure options (main). . declare (line_no. put list ('Hello. imperative computer programming language designed for scientific. pronounced "pee-el-one") is a procedural. and systems programming. The language syntax is English-like and suited for describing complex data formats. /* and then print every subsequent line that contains that string. end Hello2. linked data structure handling. line). line_no = 1. with a wide set of functions available to verify and manipulate them. It has been used by various academic. get edit (line) (L). declare pattern character (100) varying.PL/1 PROGRAMMING LANGUAGE PL/I ("Programming Language One". if index(line. and bit string handling. floating. numerical computation. on endfile (sysin) end_file = 1. engineering. world!'). get edit (pattern) (L). end_file = 0. scientific computing. character string handling. commercial and industrial organizations since it was introduced in the 1960s.