Programming for Chemical Engineers Using C, C++, and MATLAB

Let's begin by reviewing what we know so far about the C computer language. Although C is a powerful programming language, it is quite easy to learn.
This chapter will review C programming that involves:
Constant and Variable Name Declaration
Constant Name Declaration
Variable Name Declaration
Basic Output and Input Statements
Output Statements
Input Statements
Operators
Arithmetic Operators
Assignment Operators
Relational Operators
Logical Operators
Conditional Statements
if - else Statement
Nested if - else if Statement
switch/case Statement
Looping Statements
for Loop Statement
while Loop Statement
do - while Loop Statement
Arrays
Creating Functions
All program listings discussed in this chapter can be found on the CD-ROM.
\Program Listings\Chapter 1\PL1_1.c Program Listing 1.1\Program Listings\Chapter 1\PL1_2.c Program Listing 1.2\Program Listings\Chapter 1\PL1_3.c Program Listing 1.3\Program Listings\Chapter 1\PL1_4.c Program Listing 1.4\Program Listings\Chapter 1\PL1_5.c Program Listing 1.5\Program Listings\Chapter 1\PL1_6.c Program Listing 1.6\Program Listings\Chapter 1\PL1_7.c Program Listing 1.7\Program Listings\Chapter 1\PL1_8.c Program Listing 1.8\Program Listings\Chapter 1\PL1_9.c Program Listing 1.9\Program Listings\Chapter 1\PL1_10.c Program Listing 1.10\Program Listings\Chapter 1\multiply.h Multiply Header File
In order for any constant or variable name to be used in a C program, it must first be declared. However, there are some limitations when naming constants...