473,467 Members | 1,307 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

plz tell me how 2 find GCD(greater common diviser)

actually i have recently started learning C++, i have my paper of C++
tommorow......so plz help me how 2 find GCD .......

Jul 23 '05 #1
3 1546

<mu******@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
actually i have recently started learning C++, i have my paper of C++
tommorow......so plz help me how 2 find GCD .......

To get you started, I recommend that you research Euclid's algorithm:
http://en.wikipedia.org/wiki/Euclid%27s_algorithm

Regards,
Sumit.
--
Sumit Rajan <su*********@gmail.com>
Jul 23 '05 #2
<mu******@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
actually i have recently started learning C++, i have my paper of C++
tommorow......so plz help me how 2 find GCD .......


Do a google search for "Euclidean Algorithm".

--
David Hilsee
Jul 23 '05 #3
mu******@gmail.com wrote:
actually i have recently started learning C++, i have my paper of C++
tommorow......so plz help me how 2 find GCD .......


Hit the books. For instance

Knuth: The Art of Computer Programming II -- Seminumerical Algorithms
[Chapters 4.5.2 and 4.5.3, pages 333-378]

discusses various algorithms for finding the GCD in detail. Alternatively,
you can use Google (e.g., Euclid's Algorithm comes to mind).

Once you settled on a method try to implement it in C++ and when you have a
specific C++ question, we might be able to help you.
Best

Kai-Uwe Bux
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Brandon Potter | last post by:
Trying to find the best way to find common entries in an x number of ArrayLists or arrays of integers. Curious if there is a method already available in .NET to do just this very thing. ...
16
by: Justin Hoffman | last post by:
This is a question concerning query optimisation. Sorry if it's a bit long, but thanks to anyone who has the patience to help - This is my first post here... If I have two tables:...
3
by: Massimiliano Alberti | last post by:
Can someone check this? If it's OK, you can use however you want... :-) It should search for an element in an array and, if it can't find it, return the next element. key is what you are...
1
by: Nishant | last post by:
Hi there, I am looking forward to your help for comparing matrix in C++ I want to find common elements between 2 or more different matrices,using C++ for eg: A=
74
by: lovecreatesbeauty | last post by:
My small function works, but I have some questions. And I want to listen to you on How it is implemented? 1. The function does not check if parameter x is larger or smaller than parameter y. ...
4
by: sdlt85 | last post by:
Hi, Can someone help me with an idea on how to start writing a C++ code for generating greatest common divisor and the linear combination of two intergers represented as gcd(m, n)= mx + ny and...
15
by: judge82 | last post by:
I'm new to Java and I was looking for some help on this particular problem. I need to create a method that can simplify a fraction, that is, represent it as a fraction where the numerator and the...
2
by: antar2 | last post by:
Hello, I am a beginner in python. following program prints the second element in list of lists 4 for the first elements in list 4 that are common with the elements in list 5 list4 = ,,]...
4
by: jmf777 | last post by:
Hi I'm trying to write a program to find the greatest common divisor of 2 numbers input by the user. This is what I got so far: #include <stdio.h> int gcd(int a, int b); int main(void) {
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.