School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,138 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,789 people online right now. Registration is fast and FREE... Join Now!




gcd of 2 +ve integers

 

gcd of 2 +ve integers

nmettu

21 Sep, 2009 - 11:48 PM
Post #1

New D.I.C Head
*

Joined: 21 Sep, 2009
Posts: 6

hi
can any one help me in giving answer to this

Write an algorithm for computing the greatest common divisor of two positive integers by modifying the Euclidean algorithm to avoid divisions. (i.e., you need a way to compute the remainder without using division.)

User is offlineProfile CardPM
+Quote Post


Nykc

RE: Gcd Of 2 +ve Integers

22 Sep, 2009 - 10:44 AM
Post #2

This script is cheap!
Group Icon

Joined: 14 Sep, 2007
Posts: 6,561



Thanked: 44 times
Dream Kudos: 375
My Contributions
Seems pretty straightforward. lets see what you got so far. smile.gif
User is offlineProfile CardPM
+Quote Post

AdamSpeight2008

RE: Gcd Of 2 +ve Integers

22 Sep, 2009 - 10:51 AM
Post #3

The Bandido Coder
Group Icon

Joined: 29 May, 2008
Posts: 2,734



Thanked: 160 times
Dream Kudos: 3925
Expert In: vb.net, LINQ

My Contributions
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: code.gif

Thanks.
User is offlineProfile CardPM
+Quote Post

Neumann

RE: Gcd Of 2 +ve Integers

9 Oct, 2009 - 11:23 AM
Post #4

I can judge a book by its cover
Group Icon

Joined: 8 Jul, 2009
Posts: 686



Thanked: 93 times
Dream Kudos: 225
My Contributions
Pretty simple, use subtraction until you find the smallest positive integer. That integer will be your remainder.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 03:19PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month