Program for greatest common divisor – c++ program, C/C++ Programming

Greatest Common Divisor (GCD) -

The greatest common divisor (GCD) of two integers is the largest integer that will evenly divide both integers. The GCD algorithm involves integer division in a loop, described by the following C++ code: intGCD(int x, int y) { x = abs(x); y = abs(y); do {   int n = x % y;   x = y;   y = n; } while (y > 0); return x; } // absolute value Implement this function in assembly language and write a test program that calls the function several times, passing it different values. Display all results on the screen.

Posted Date: 3/29/2013 1:51:43 AM | Location : United States







Related Discussions:- Program for greatest common divisor – c++ program, Assignment Help, Ask Question on Program for greatest common divisor – c++ program, Get Answer, Expert's Help, Program for greatest common divisor – c++ program Discussions

Write discussion on Program for greatest common divisor – c++ program
Your posts are moderated
Related Questions
want to understand the working of structure and classes

Define Functions with arguments and no return values The calling function will read a data from the terminal and pass it on to called as function and this will work good as the

Receive 3 numbers and display them in ascending order from smallest to largest ed#

Object Conversions Just like initialization, conversions are also done automatically when an object of a derived class is assigned to an object of the base class. Though, the c

write a c++ program to update employee records

What is constructor or ctor? need help

payment system, in c++ only..just use the printf or scanf.please

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send