C How to Program, 6/e ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

C How to Program, 6/e ©1992-2010 by Pearson Education, Inc. All Rights Reserved. www.phwiki.com

C How to Program, 6/e ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

Brando, Tim, Midday Drive-Time Host has reference to this Academic Journal, PHwiki organized this Journal C How to Program, 6/e ©1992-2010 by Pearson Education, Inc. All Rights Reserved. ©1992-2010 by Pearson Education, Inc. All Rights Reserved. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

Elms College US www.phwiki.com

This Particular University is Related to this Particular Journal

The core of the book emphasizes achieving program clarity through the proven techniques of structured programming. You’ll learn programming the right way from the beginning. We present hundreds of complete working programs in addition to shows the outputs produced when those programs are run on a computer. We call this the “live-code approach.” All of these example programs may be downloaded from our website www.deitel.com/books/chtp6/. It’s software (i.e., the instructions you write to comm in addition to computers to per as long as m actions in addition to make decisions) that controls computers (often referred to as hardware). ©1992-2010 by Pearson Education, Inc. All Rights Reserved. This text introduces programming in C, which was st in addition to ardized in 1989 as ANSI X3.159-1989 in the United States through the American National St in addition to ards Institute (ANSI), then worldwide through the ef as long as ts of the International St in addition to ards Organization (ISO). We call this St in addition to ard C. We also introduce C99 (ISO/IEC 9899:1999)—the latest version of the C st in addition to ard. A new C st in addition to ard, which has been in as long as mally named C1X, is under development in addition to likely to be published around 2012. Optional Appendix E presents the Allegro game programming C library. ©1992-2010 by Pearson Education, Inc. All Rights Reserved. The appendix shows how to use Allegro to create a simple game. We show how to display graphics in addition to smoothly animate objects, in addition to we explain additional features such as sound, keyboard input in addition to text output. The appendix includes web links in addition to resources that point you to over 1000 Allegro games in addition to to tutorials on advanced Allegro techniques. Computing costs have decreased dramatically due to rapid developments in both hardware in addition to software technologies. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

The large computers introduced decades ago were called mainframes in addition to current versions are widely used today in business, government in addition to industry. Silicon chip technology has made computing so economical that more than a billion general-purpose computers are in use worldwide. Billions more special purpose computers are used in intelligent electronic devices like car navigation systems, energy-saving appliances in addition to game controllers. ©1992-2010 by Pearson Education, Inc. All Rights Reserved. C++, an object-oriented programming language based on C, is of such interest today that we’ve included a detailed introduction to C++ in addition to object-oriented programming in the later chapters. To keep up to date with C in addition to C++ developments at Deitel & Associates, register as long as the Deitel® Buzz Online, at www.deitel.com/newsletter/subscribe.html Check out the growing list of C in addition to related Resource Centers at www.deitel.com/ResourceCenters.html ©1992-2010 by Pearson Education, Inc. All Rights Reserved. Some Resource Centers that will be valuable to you as you read the C portion of this book are C, Code Search Engines in addition to Code Sites, Computer Game Programming in addition to Programming Projects. Errata in addition to updates as long as this book are posted at www.deitel.com/books/chtp6/ ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

A computer is a device that can per as long as m computations in addition to make logical decisions billions of times faster than human beings can. Many of today’s personal computers can per as long as m several billion additions per second. Today’s fastest supercomputers can per as long as m thous in addition to s of trillions (quadrillions) of instructions per second! To put that in perspective, a quadrillion-instruction-per-second computer can per as long as m more than 100,000 calculations per second as long as every person on the planet! ©1992-2010 by Pearson Education, Inc. All Rights Reserved. Computers process data under the control of sets of instructions called computer programs These programs guide the computer through orderly sets of actions specified by people called computer programmers. A computer consists of various devices referred to as hardware (e.g., the keyboard, screen, mouse, hard disk, memory, DVDs in addition to processing units). The programs that run on a computer are referred to as software. Hardware costs have been declining dramatically in recent years, to the point that personal computers have become a commodity. ©1992-2010 by Pearson Education, Inc. All Rights Reserved. In this book, you’ll learn proven methods that are reducing software development costs—structured programming (in the C chapters) in addition to object-oriented programming (in the C++ chapters). ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

Every computer may be envisioned as divided into six logical units or sections: Input unit. This “ receiving” section obtains in as long as mation (data in addition to computer programs) from input devices in addition to places it at the disposal of the other units so that it can be processed. Humans typically enter in as long as mation into computers through keyboards in addition to mouse devices. In as long as mation also can be entered in many other ways, including by speaking to your computer, scanning images in addition to barcodes, reading from secondary storage devices (like hard drives, CD drives, DVD drives in addition to USB drives—also called “thumb drives”) in addition to having your computer receive in as long as mation from the Internet (such as when you download videos from YouTube™, e-books from Amazon in addition to the like). ©1992-2010 by Pearson Education, Inc. All Rights Reserved. Output unit. This “ shipping” section takes in as long as mation that the computer has processed in addition to places it on various output devices to make it available as long as use outside the computer. Most in as long as mation that is output from computers today is displayed on screens, printed on paper, played on audio players (such as Apple’s popular iPods), or used to control other devices. Computers also can output their in as long as mation to networks, such as the Internet. ©1992-2010 by Pearson Education, Inc. All Rights Reserved. Memory unit. This rapid-access, relatively low-capacity “warehouse” section retains in as long as mation that has been entered through the input unit, making it immediately available as long as processing when needed. The memory unit also retains processed in as long as mation until it can be placed on output devices by the output unit. In as long as mation in the memory unit is volatile—it’s typically lost when the computer’s power is turned off. The memory unit is often called either memory or primary memory. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

Arithmetic in addition to logic unit (ALU). This “ manufacturing” section per as long as ms calculations, such as addition, subtraction, multiplication in addition to division. It also contains the decision mechanisms that allow the computer, as long as example, to compare two items from the memory unit to determine whether they’re equal. In today’s systems, the ALU is usually implemented as part of the next logical unit, the CPU. ©1992-2010 by Pearson Education, Inc. All Rights Reserved. Central processing unit (CPU). This “ administrative” section coordinates in addition to supervises the operation of the other sections. The CPU tells the input unit when to read in as long as mation into the memory unit, tells the ALU when in as long as mation from the memory unit should be used in calculations in addition to tells the output unit when to send in as long as mation from the memory unit to certain output devices. Many of today’s computers have multiple CPUs in addition to , hence, can per as long as m many operations simultaneously—such computers are called multiprocessors. A multi-core processor implements multiprocessing on a single integrated circuit chip— as long as example a dual-core processor has two CPUs in addition to a quad-core processor has four CPUs. ©1992-2010 by Pearson Education, Inc. All Rights Reserved. Secondary storage unit. This is the long-term, high-capacity “warehousing” section. Programs or data not actively being used by the other units normally are placed on secondary storage devices (e.g., your hard drive) until they’re again needed, possibly hours, days, months or even years later. There as long as e, in as long as mation on secondary storage devices is said to be persistent—it is preserved even when the computer’s power is turned off. Secondary storage in as long as mation takes much longer to access than in as long as mation in primary memory, but the cost per unit of secondary storage is much less than that of primary memory. Examples of secondary storage devices include CDs, DVDs in addition to flash drives (sometimes called memory sticks), which can hold hundreds of millions to billions of characters. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

In 1977, Apple Computer popularized personal computing. In 1981, IBM, the world’s largest computer vendor, introduced the IBM Personal Computer (PC). This quickly legitimized personal computing in business, industry in addition to government organizations, where IBM mainframes were heavily used. These computers were “st in addition to -alone” units—people transported disks back in addition to as long as th between them to share in as long as mation (this was often called “sneakernet”). These machines could be linked together in computer networks, sometimes over telephone lines in addition to sometimes in local area networks (LANs) within an organization. ©1992-2010 by Pearson Education, Inc. All Rights Reserved. This led to the phenomenon of distributed computing. In as long as mation is shared easily across computer networks, where computers called servers (file servers, database servers, web servers, etc.) offer capabilities that may be used by client computers distributed throughout the network, hence the term client/server computing. C is widely used as long as writing software as long as operating systems, as long as computer networking in addition to as long as distributed client/server applications. ©1992-2010 by Pearson Education, Inc. All Rights Reserved. With the introduction of the World Wide Web—which allows computer users to locate in addition to view multimedia-based documents on almost any subject over the Internet—the Internet has exploded into the world’s premier communication mechanism. Today’s applications can be written to communicate among the world’s computers. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

Programmers write instructions in various programming languages, some directly underst in addition to able by computers in addition to others requiring intermediate translation steps. Computer languages may be divided into three general types: Machine languages Assembly languages High-level languages Any computer can directly underst in addition to only its own machine language. Machine language is the “natural language” of a computer in addition to as such is defined by its hardware design. ©1992-2010 by Pearson Education, Inc. All Rights Reserved. Machine language is often referred to as object code. Machine languages generally consist of strings of numbers (ultimately reduced to 1s in addition to 0s) that instruct computers to per as long as m their most elementary operations one at a time. Machine languages are machine dependent (i.e., a particular machine language can be used on only one type of computer). ©1992-2010 by Pearson Education, Inc. All Rights Reserved. Such languages are cumbersome as long as humans, as illustrated by the following section of an early machine-language program that adds overtime pay to base pay in addition to stores the result in gross pay: +1300042774 +1400593419 +1200274027 Instead of using the strings of numbers that computers could directly underst in addition to , programmers began using English-like abbreviations to represent elementary operations. These abbreviations as long as med the basis of assembly languages. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

Brando, Tim Sporting News Radio Network Midday Drive-Time Host www.phwiki.com

Translator programs called assemblers were developed to convert early assembly-language programs to machine language at computer speeds. The following section of an assembly-language program also adds overtime pay to base pay in addition to stores the result in gross pay: load basepay add overpay store grosspay Although such code is clearer to humans, it’s incomprehensible to computers until translated to machine language. ©1992-2010 by Pearson Education, Inc. All Rights Reserved. Computer usage increased rapidly with the advent of assembly languages, but programmers still had to use many instructions to accomplish even the simplest tasks. To speed the programming process, high-level languages were developed in which single statements could be written to accomplish substantial tasks. Translator programs called compilers convert high-level language programs into machine language. High-level languages allow programmers to write instructions that look almost like everyday English in addition to contain commonly used mathematical notations. ©1992-2010 by Pearson Education, Inc. All Rights Reserved. A payroll program written in a high-level language might contain a statement such as grossPay = basePay + overTimePay; C, C++, Microsoft’s .NET languages (e.g., Visual Basic, Visual C++ in addition to Visual C ) in addition to Java are among the most widely used high-level programming languages. Interpreter programs were developed to execute high-level language programs directly (without the delay of compilation), although slower than compiled programs run. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

C evolved from two previous languages, BCPL in addition to B. BCPL was developed in 1967 by Martin Richards as a language as long as writing operating-systems software in addition to compilers. Ken Thompson modeled many features in his B language after their counterparts in BCPL, in addition to in 1970 he used B to create early versions of the UNIX operating system at Bell Laboratories. Both BCPL in addition to B were “typeless” languages—every data item occupied one “word” in memory, in addition to the burden of typing variables fell on the shoulders of the programmer. ©1992-2010 by Pearson Education, Inc. All Rights Reserved. The C language was evolved from B by Dennis Ritchie at Bell Laboratories in addition to was originally implemented on a DEC PDP-11 computer in 1972. C initially became widely known as the development language of the UNIX operating system. Today, virtually all new major operating systems are written in C in addition to /or C++. C is available as long as most computers. C is mostly hardware independent. With careful design, it’s possible to write C programs that are portable to most computers. ©1992-2010 by Pearson Education, Inc. All Rights Reserved. By the late 1970s, C had evolved into what is now referred to as “traditional C.” The publication in 1978 of Kernighan in addition to Ritchie’s book, The C Programming Language, drew wide attention to the language. The rapid expansion of C over various types of computers (sometimes called hardware plat as long as ms) led to many variations that were similar but often incompatible. In 1989, the C st in addition to ard was approved; this st in addition to ard was updated in 1999. C99 is a revised st in addition to ard as long as the C programming language that refines in addition to exp in addition to s the capabilities of C. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

©1992-2010 by Pearson Education, Inc. All Rights Reserved. ©1992-2010 by Pearson Education, Inc. All Rights Reserved.

Brando, Tim Midday Drive-Time Host

Brando, Tim is from United States and they belong to Sporting News Radio Network and they are from  Scottsdale, United States got related to this Particular Journal. and Brando, Tim deal with the subjects like Sports

Journal Ratings by Elms College

This Particular Journal got reviewed and rated by Elms College and short form of this particular Institution is US and gave this Journal an Excellent Rating.