pseudo code and flow charts

how can write a pseudo code and a flow charts to solve these?
1 to find the greatest common divisor out of two positive integers.
2 to find the smallest common factor out of two positive intrgers.

Write the flow of thinking just as you do it in your head. Work through a sample problem on paper, then model your process as a flow chargt.

Note that you can define the greatest common divisor function recursively:

GCD[x,y] = GCD[y Mod x,x]

And GCD[0,x] = x

  1. 👍 0
  2. 👎 0
  3. 👁 150
asked by ravindu
  1. ascascasc

    1. 👍 0
    2. 👎 0
    posted by acasc
  2. READ a,b;
    a>=n
    C=a%b
    If c=0
    DISPLAY n is the GCD;
    If c is not equal to 0
    REPLACE a with b and b with the c and go to c=a%b

    1. 👍 0
    2. 👎 0

Respond to this Question

First Name

Your Response

Similar Questions

  1. wollega

    draw flow chart & write pseudo code for greatest common divisor of two numbers

    asked by motuma on May 11, 2016
  2. cms

    suppose in a positive numbers(including o) and the negative numbers are to be separately counted. a) draw a flow chart. write the pseudo code.

    asked by osele madighi on November 16, 2016
  3. computer science

    5. Calculation of tax in Ruritania In a fictitious country of Ruritania, which is in a fictitious continent called Afrisia, the tax system is highly simplified. They have system where all taxes are converted to one single value

    asked by Bofelo on October 28, 2015
  4. fundamental to programing

    design an algorithm that reads three numbers and prints that smallest number.using pseudo code and flow chart

    asked by baikedagn on December 8, 2014
  5. programming

    Week 3 - Expand Pseudo Code The accounting office indicated the code must be able to handle overtime hours. Add functionality to your pseudo code so that if more than 40 hours are worked, the hours over 40 receive time and a half

    asked by John on February 22, 2010
  6. Algorithm

    write a pseudo code algorithm that will accept 20 numbers and finds their product

    asked by chinna on July 16, 2012
  7. Math

    Hello i need some help writing a pseudo code equation. It is pretty basic. Can anyone help? Just want to know before i write the entire problem out. Thanks

    asked by Ti on October 31, 2007
  8. college computer science

    Write a pseudo code that allows a user to enter the names and phone numbers of up to 20 friends

    asked by alhassan fuseini Baba on December 21, 2017
  9. Computer Science/Pseudo Code Python

    Hi, I'm confused about an assignment. I'm not sure what to do and would like some help. An example: Write a program that obtains two integer numbers from the user. It will print out the sum of those numbers. Pseudo code: Prompt

    asked by Rain on February 28, 2016
  10. pseudo code algorithm

    Convert your algorithm from Question One into a complete Java application. Marks will be allocated based upon: ● Your Java code matching your pseudo code algorithm from Question One. ● Your Java code being syntactically

    asked by husanpreet on April 27, 2016

More Similar Questions