Professional Documents
Culture Documents
Arrenan Ratnaveluppillai Flowcharts
Arrenan Ratnaveluppillai Flowcharts
Arrenan Ratnaveluppillai Flowcharts
START
IInput P&Q
Q = 0?
No
Yes
X = P/Q
Output X
STOP
Input X and output the absolute value ABS of X (that is, ABS = X if X >= 0, ABS = -X if X < 0).
START
IInput X
Yes X > 0?
No X = -X
Output X
STOP
Input three numbers I, J, and K. If they are all different, set N=1. If any two of them (but not all three) are the same, set N=2. If all three are the same, set N=3.
3.
Start
Input: I, J, K
Yes?
No?
No?
Yes?
I=K?
Output: N
Stop
Input an integer N between 1 and 20 and determine whether it is even or odd by subtracting 2 repeatedly until either 0 or a negative number is reached. If N is even, set M = 0; if N is odd, set M = 1. Start
Input: N
Yes? N>20?
N=N-2
M=0
M=1
Yes? N<0?
No?
Input: N
Stop
Input an integer N greater than 0 and output the sum of all positive integers less than N.
Start
Input: N
Yes? N<0?
No? Sum=0
M=0
M=M+1
Output: Sum
Stop