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

4.1. Basic Building Blocks of a Programming Language

While the specific rules of a programming language differ from one language to another, the underlying foundation upon which all programming languages are built is pretty much the same. There is a hierarchy that all languages follow. This hierarchy is:

Programs Statements Expressions Operands and Operators

You can verbalize this hierarchy like this: "Programs consist of one or more statements. Statements consist of one or more expressions. Expressions consist of one or more operands in conjunction with one or more operators." Therefore, to write a program you must understand operands and operators. We begin our journey into the innards of C# by learning about operands and operators.

4.1.1. Operands and Operators

In Chapter 3 you wrote a program that used two variables to store the information that was entered by the user. The program was designed to divide the first number by the second number. Suppose the user typed in 10 for the first number and 6 for the second. You've been doing this kind of math since you were in grade school. We can write the process of dividing 10 by 6 as:

10 / 6

This simple math process involves taking ...

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