
22 Programming for Chemical Engineers
11 do
12 {
13 conc = init_con - (k*time);
14 printf(“ %d\t\t%lf\n”,time,conc);
15 time=time+10;
16 }while (time<70);
17 system(“pause”);
18 return 0;
19 }
Lines 11 to 16: These lines cover the do - while statement. Note that looping
is done as long as
time is less than 70.
ARRAYS
An array is a type of variable that can store one or more values having similar data
types with reference to only one variable name. This can be identified through
a pair of square brackets (
[]).
Syntax for one-dimensional type of arrays:
Datatype array_name[index];
array[0]=10; array[1]=20; array[2]=30;
This can also be initialized as:
FIGURE ...