homework_7_1

homework_7_1 - 1. N>M, N=N-M: 24-14=10 2. M>N, M=M-N:...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
M = 44; N = 28; while (M ~= N); while M > N; M = M - N; end while N > M; N = N - M; end end disp (M) A.for M=44, N=28 1. M>N, M= M-N: 44-28=16 2. N>M, N= N-M: 28-16=12 3. M>N, M=M-N:16-12= 4 4. N>M, N=N-M:12-4= 8 5. N>M, N=N-M:8-4=4 6. N=M = 4 B. for M=14, N=24
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1. N>M, N=N-M: 24-14=10 2. M>N, M=M-N: 14-10=4 3. N>M, N=N-M: 10-4=6 4. N>M, N=N-M: 6-4=2 5. M>N, M=M-N: 4-2=2 6. M=N = 2 C. The process performs subtraction and then substitution...
View Full Document

This note was uploaded on 04/07/2008 for the course COMPSCI 1 taught by Professor M during the Spring '08 term at Stevens.

Ask a homework question - tutors are online