Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Numerical MethodsRSS Feeds

Program of addition, subtraction,multiplication and division of rational numbers

Posted By: Hannah Campbell     Category: C Programming     Views: 11667

Program of addition, subtraction,multiplication and division of rational numbers.

Code for Program of addition, subtraction,multiplication and division of rational numbers in C Programming

#include<stdio.h>
#include<conio.h>
#include "rtnl.h"// included in zipvoid main()
{
    clrscr();
    Rational r1,r2,sum,sub,mul,div;
    printf("\nEnter the First Rational Number.");
    r1=getRational();

    printf("\nEnter the Second Rational Number.");
    r2=getRational();

    sum=addRational(r1,r2);
    sub=subtractRational(r1,r2);
    mul=multiplyRational(r1,r2);
    div=divideRational(r1,r2);

    printf("\nADDITION IS : ");
    displayRational(sum);

    printf("\nSUBTRACTION IS : ");
    displayRational(sub);

    printf("\nMULTIPLICATION IS : ");
    displayRational(mul);

    printf("\nDIVISION IS : ");
    displayRational(div);

    getch();
}[/Code]
  
Share: 



Hannah Campbell
Hannah Campbell author of Program of addition, subtraction,multiplication and division of rational numbers is from Toronto, Canada.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
Pari Omed from India Comment on: Nov 30
Please make it more useful !
Not interesting at all code are not working

View All Comments