You are on page 1of 2

Example D:

ALGORITHM

1. Read in the values X and Y.


2. Determine the difference between X AND Y.
3. Compute R=X+Y if X-Y is negative, compute R=X+Y IF 0 and compute R=X*Y if X-Y Is positive.
4. Print out the values of X, Y, and R.

FLOWCHART

START

Read X
and Y

Determine X
and Y

-XY, R=X+Y

0, R=2X +2Y

XY, R=X*Y

Print X,
Y and R.

END
Example A:

FLOWCHART

START

You might also like