Skip to content

C++ program to calculate Greatest Common Divisor (GCD)

Notifications You must be signed in to change notification settings

shahriar-siraj/gcd_cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

C++ program to calculate Greatest Common Divisor (GCD)

Problem:

Write a function named "reduce" that takes two positive integer arguments, call them "num" and "denom", treats them as the numerator and denominator of a fraction, and reduces the fraction. That is to say, each of the two arguments will be modified by dividing it by the greatest common divisor of the two integers. The function should return the value 0 to indicate failure to reduce if either of the two arguments is zero or negative, and should return the value 1 otherwise.

About

C++ program to calculate Greatest Common Divisor (GCD)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages