<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>rational number arithmetic | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/rational-number-arithmetic/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sun, 04 Apr 2010 13:34:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>C++ class program to perform rational number arithmetic</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-class-program-to-perform-rational-number-arithmetic/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-class-program-to-perform-rational-number-arithmetic/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sun, 04 Apr 2010 13:34:26 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[Source Codes]]></category>
		<category><![CDATA[C Programs]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[rational number arithmetic]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1140</guid>

					<description><![CDATA[<p>Write a program to perform rational number arithmetic. #include #include #include class rational { int numer; int denom; public: void getdata() { coutnumer; coutdenom; } void operator+(rational); void operator-(rational); void operator *(rational); void operator /(rational); }; void rational ::operator+(rational c1) { rational temp; temp.numer=(numer*c1.denom)+(c1.numer*denom); temp.denom=denom*c1.denom; cout</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-class-program-to-perform-rational-number-arithmetic/">C++ class program to perform rational number arithmetic</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Write a program to perform rational number arithmetic.</p>
<pre lang="cpp">
 #include<stdio.h> 	
 #include<iostream.h>
 #include<conio.h>
 class rational 
 {
	 int numer;
	 int denom;
	 public:
	 void getdata()
	 {
		 cout<<"\n enter the numerator part of the rational no.";
		 cin>>numer;
		 cout<<"\n enter the denominator part of the rational no.";
		 cin>>denom;
	 }
	 void operator+(rational);
	 void operator-(rational);
	 void operator *(rational);
	 void operator /(rational);
 };
 void rational ::operator+(rational c1)
 {
	 rational temp;
	 temp.numer=(numer*c1.denom)+(c1.numer*denom);
	 temp.denom=denom*c1.denom;
	 cout<<"\nrational no. after addition";
	 cout<<"\n numerator="<<temp.numer<<"\n denominator ="<<temp.denom;
 }
 void raional ::operator -(rational c1)
 {
	 rational temp;
	 temp.numer=(numer*c1.denom)-(c1.numer*denom);
	 temp.denom=denom*c1.denom;
	 cout<<"\n rational no. after subtraction";
	 cout<<"\n numerator="<<temp.numer<,"\n denominator ="<<temp.denom;
 }
 void rational ::operator (rational c1)
 {
	 rational temp;
	 temp.numer=numer*c1.numer;
	 temp.denom=denom*c1.denom;
	 cout<<"\n rational no. after multiplication";
	 cout <<"\n numerator="<temp.numer<<"\n denominator ="<< temp.denom;
 }
 void rational :: operator /(rational c1)
 {
	 rational temp;
	 temp.numer= numer*c1.denom;
	 temp.denom=c1.numer*denom;
	 cout<<"\n rational no. after dividation";
	 cout <<"\n numerator="<<temp.numer<<"\n denominator ="<<temp.denom;
 }
 void main()
 { 
	 clrscr();
	 rational c1, c2;
	 int n;
	 do 
	 {
		 cout<<"\n 1.Input data for rational no. ";
		 cout<<"\n 2. Addition of rational no. "; 
		 cout<<"\n 3. Subtraction of rational no. ";
		 cout<<"\n 4. Multiplication of rational no.";
		 cout<<\n  5. Division of rational no. ";
		 cout<<"\n 6. Quit";
		 cout<<"\n Enter your choice";
		 cin>>n;
		 switch(n)
		 {
			 case 1:
			 cout<<endl<<"\n enter the data for first rational no.";
			 c1.getdata();
			 cout<<endl<<"\n enter the data for second rational no. ";
			 c2.getdata ();
			 clrscr();
			 break;
			 case 2;
			 c1+c2;
			 getch();
			 clrscr();
			 break;
			 case 3;
			 c1-c2;
			 getch();
			 clrscr();
			 case 4: 
			 c1*c2;
			 getch();
			 clrscr();
			 break;
			 case 5:
			 c1/c2;
			 getch();
			 clrscr();
			 break;
			 case 6:
			 exit(1);
			 break;
		 }
	 } while (n!=6);
	 getch();
 }
</pre><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-class-program-to-perform-rational-number-arithmetic/">C++ class program to perform rational number arithmetic</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-class-program-to-perform-rational-number-arithmetic/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
