If the function is passed an argument that is not positive


Write a function named "g_c_d" that takes twopositiveinteger arguments and returns as its value the greatest common divisor of those two integers. If the function is passed an argument that is not positive (i.e., greater than zero), then the function should return the value 0 as a sentinel value to indicate that an error occurred. Thus, for example,

cout will print 10

cout will print 1

cout will print 6

12

cout will print 0 (even though 32 is the g.c.d.)

cout will print 0 (even though 2 is the g.c.d.)

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: If the function is passed an argument that is not positive
Reference No:- TGS01405090

Expected delivery within 24 Hours