Skip to Content
Beginning C# 3.0
book

Beginning C# 3.0

by Jack Purdum
May 2008
Beginner
550 pages
13h 22m
English
Wrox
Content preview from Beginning C# 3.0

Chapter 3. Understanding Data Types

As you learned in Chapter 2, computer programs often input data in one form, process it, and then show the new data on the computer screen. This kind of invites the question: What is data? Simply stated, data is information. Computer data is information that is stored in a variable for use in a program. In a broad sense, there are two basic kinds of computer data: 1) numeric data and 2) textual data.

Numeric data is any kind of data that can have arithmetic operations performed on it. You can add, subtract, multiply, and divide numeric data. You can perform other operations on numeric data, like finding a square root, a sine, or a cosine of a numeric quantity, and so on. You will also hear numeric data types referred to as value types. The precise meaning of this term is discussed in Chapter 5. For now, however, you can think of them as those data types whose variables can have data stored directly into them.

Textual data are character representations of data. Your name is a piece of data that can be represented in a program in a textual fashion. Some students get confused when you ask them whether a zip code is numeric or textual information. Because zip codes are usually not manipulated in mathematical expressions (for example, you wouldn't need to multiply or divide a zip code), they are usually treated as textual information.

This chapter discusses the different data types C# provides to you. In this chapter, you will learn about the following: ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Navigating the Metaverse

Navigating the Metaverse

Cathy Hackl, Dirk Lueth, Tommaso Di Bartolo, John Arkontaky, Yat Siu
What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz
Capitalism at Risk

Capitalism at Risk

Joseph L. Bower, Herman B. Leonard, Lynn S. Paine

Publisher Resources

ISBN: 9780470261293Purchase book