alright, i have this project i'm working on where one needs to read several numbers from a file and find their gcd two numbers at a time.
for example
first two numbers on the file are 43 and 5 which when read need to output:
43 5
56 4 (etc.)
with a space between them (important)
when the program calculates the gcd of the two numbers, the output needs to be
43 5 1
56 4 4
etc.
i have the algorithm for gcd, but have no idea how to read from file, put spaces, read two numbers at a time and then have the gcd algorithm calculate the gcd for those given numbers and then put them in that desired output.
even further, i need to have these numbers and output files placed into its own separate file. which of course, i have no idea how to do.
if anyone can point or hint (not asking you to do work for me) on the correct direction i need to take to do this project, i will be so grateful.
like i said, i have no idea where to start.
i know how to open a file, close a file, but i don't really understand how i am supposed to read two numbers at a time...and calc gcd and output like that specifically.
thank you so much in advance if anyone reads this. i'm backed into a corner and on the ropes.