954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Basic arithemetic on rational numbers

Hi
Modify this where possible

Attachments FRACTIONS.txt (3.58KB)
RIsagara
Newbie Poster
7 posts since Apr 2009
Reputation Points: 10
Solved Threads: 2
 
Hi Modify this where possible


And what exactly do you want to modify? Ask a specific question.

yellowSnow
Posting Whiz in Training
203 posts since Jul 2009
Reputation Points: 651
Solved Threads: 35
 

"interger" is spelled "integer"
"valve" is spelled "value"

Beg.CProgrammer
Newbie Poster
12 posts since Oct 2009
Reputation Points: 10
Solved Threads: 2
 
And what exactly do you want to modify? Ask a specific question.


you realize that it cannot give 0/4=0,
I also limited the user from entering 0,
modify the Gcd method to reduce the fraction recursively,

RIsagara
Newbie Poster
7 posts since Apr 2009
Reputation Points: 10
Solved Threads: 2
 

/*A PROGRAM PERFORMING BASIC ARITHMETIC ON RATIONAL NUMBERS*/

/*BY ISAGARA K ROBERT*/
/*26th october 2009*/
/*THIS WAS MY ASSIGNMENT(COMPUTER SCIENCE YEAR II) TO MR PAUL BAGYENDA ON BASIC ARITHMETIC OPERATION ON RATIONAL NUMBERS*/

#include
#include

typedef struct rational_t {
int numer;
int denom;
} rational_t;
/*modify this for me*/
static int gcd(int a, int b)
{ int c;
while(a>0)
{
if(a

RIsagara
Newbie Poster
7 posts since Apr 2009
Reputation Points: 10
Solved Threads: 2
 

Gentle thanks for the modification but I did not really mean sp

RIsagara
Newbie Poster
7 posts since Apr 2009
Reputation Points: 10
Solved Threads: 2
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You