Skip to main content

Introduction

One way to think about programming is that a program applies a series of instructions to a set of data in order to produce some result. For example, consider the software that is used to calculate income taxes. These programs have encode the rules of calculating income taxes. The actual results is based on the data supplied to the software by the user and other data sources. The program is the same no matter who uses it. However, the data used depends on what is entered and thus the final tax balance will be different.

Learning Outcomes

After completing this chapter, students will be able to:

  1. Explain the relationship between bits, bytes, and data storage and calculate the number of values that can be represented using nn bits
  2. Distinguish between different data types (char, int, float, double) and select appropriate types for specific programming tasks
  3. Declare and initialize variables using proper C syntax and naming conventions
  4. Understand data abstraction and explain how computers interpret binary data as different types of information
  5. Apply type conversions including narrowing, promoting, and explicit casting, and predict the consequences of each
  6. Use printf() and scanf() with format codes and modifiers to perform interactive input and output
  7. Write interactive C programs that read user input, store data in variables, and display formatted output