<?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>Binary operator | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/binary-operator/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 13 Mar 2010 13:15:11 +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++ program to perform arithmetic operations of two complex numbers using operator overloading</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-perform-arithmetic-operations-of-two-complex-numbers-using-operator-overloading/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-perform-arithmetic-operations-of-two-complex-numbers-using-operator-overloading/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sat, 13 Mar 2010 13:15:11 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[C Programs]]></category>
		<category><![CDATA[c++ overloading]]></category>
		<category><![CDATA[operator overloading]]></category>
		<category><![CDATA[complex numbers]]></category>
		<category><![CDATA[operations]]></category>
		<category><![CDATA[Binary operator]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1054</guid>

					<description><![CDATA[<p>BINARY OPERATOR AIM: A program to perform simple arithmetic operations of two complex numbers using operator overloading. ALGORITHAM: • Start the process • Get the complex value a.real and a.image • Check while ((ch=getchar())!=’q’) o True : execute switch(ch) o Case ‘a’:Then Compute cb.imag; menu(); while ((ch = getchar()) != 'q') { switch(ch) { case</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-perform-arithmetic-operations-of-two-complex-numbers-using-operator-overloading/">C++ program to perform arithmetic operations of two complex numbers using operator overloading</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><strong>BINARY OPERATOR</strong></p>
<p>AIM:<br />
A program to perform simple arithmetic operations of two complex numbers using operator overloading.</p>
<p><strong>ALGORITHAM: </strong></p>
<p>•	Start the process<br />
•	Get the complex value a.real and a.image<br />
•	Check while ((ch=getchar())!=’q’)<br />
o	True : execute switch(ch)<br />
o	Case ‘a’:Then<br />
Compute c<-a+b, Print c.real and c.imag
o	Case ‘s’: Then
Compute c<-a-b, Print c.real and c.imag
o	Case ‘m’: Then
Compute c<-a*b, Print c.real and c.imag
o	Case ‘d’: Then
Compute c<-a/b, Print c.real and c.imag
o	End of switch
•	End of while
•	Stop the process

<strong>PROGRAM</strong></p>
<pre lang="cpp">
#include<iostream.h>
#include<conio.h>
#include<string.h>
struct complex
{
float real;
float imag;
};
complex operator + (complex a,complex b);
complex operator - (complex a,complex b);
complex operator * (complex a,complex b);
complex operator / (complex a,complex b);

void main()
{
complex a,b,c;
int ch;
void menu(void);clrscr();
cout<<"Enter the first complex no:";
cin>>a.real>>a.imag;
cout<<"Enter the second complex no:";
cin>>b.real>>b.imag;
menu();
while ((ch = getchar()) != 'q')
{
switch(ch)
{
case 'a':c =a + b;
cout<<"Addition of 2 no’s";
cout<<c.real<<"+i"<<c.imag;
break;
case 's':c=a-b;
cout<<"Substraction of 2 no’s";
cout<<c.real<<"i"<<c.imag;
break;
case 'm':c=a*b;
cout<<"Multiplication of 2 no’s";
cout<<c.real<<"i"<<c.imag;
break;
 				case 'd':c=a/b;
cout<<"Division of 2 no’s";
cout<<c.real<<"i"<<c.imag;
break;
 			}
 		}
 	}
 	void menu()
{
cout<<"complex no: operators";
cout<<"a->addition";
cout<<"s->substraction";
cout<<"m->multiplication";
cout<<"d->division";
cout<<"q->quit";
cout<<"options please";
}
complex operator -(struct complex a, struct complex b)
{
complex c;
c.real=a.real-b.real;
c.imag=a.imag-b.imag;
return(c);
}
complex operator *(struct complex a, struct complex b)
{
complex c;
c.real=((a.real*b.real)-(a.imag*b.imag));
c.imag=((a.real*b.imag)+(a.imag*b.real));
return(c);
}
complex operator +(struct complex a,struct complex b)
{
complex c;
c.real=a.real+b.real;
c.imag=a.imag+b.imag;
return(c);
}
complex operator /(struct complex a, struct complex b)
{
complex c;
float temp;
temp=((b.real*b.real)+(b.imag*b.imag));
c.real=((a.real*b.real)+(a.imag*b.imag))/temp;
  		 return(c);
}
</pre>
<p><strong>OUTPUT</strong></p>
<p>Enter the first complex no: 1,1<br />
Enter the second complex no: 2,2</p>
<p>Addition of 2 no’s :   3+I3</p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-perform-arithmetic-operations-of-two-complex-numbers-using-operator-overloading/">C++ program to perform arithmetic operations of two complex numbers using operator overloading</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-program-to-perform-arithmetic-operations-of-two-complex-numbers-using-operator-overloading/feed/</wfw:commentRss>
			<slash:comments>15</slash:comments>
		
		
			</item>
	</channel>
</rss>
