<?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>Logical Operators | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/logical-operators/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 10 Dec 2022 04:46:10 +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>Operators in C++ Part II</title>
		<link>https://studentprojects.in/software-development/cpp/c-tutorials-cpp/operators-in-c-part-ii/</link>
					<comments>https://studentprojects.in/software-development/cpp/c-tutorials-cpp/operators-in-c-part-ii/#respond</comments>
		
		<dc:creator><![CDATA[Shubhajna Rai]]></dc:creator>
		<pubDate>Sun, 11 Dec 2022 07:49:00 +0000</pubDate>
				<category><![CDATA[C++ Tutorials]]></category>
		<category><![CDATA[operators in c]]></category>
		<category><![CDATA[Relational Operators]]></category>
		<category><![CDATA[Logical Operators]]></category>
		<guid isPermaLink="false">https://studentprojects.in/?p=9829</guid>

					<description><![CDATA[<p>Relational Operators Relational operators are used to check the relationship between two operands and to compare two or more numbers or even expressions in cases. The return type of a relational operator is a Boolean that is, either True or False (1 or 0). Operator Description &#62; Greater than &#60; Less than &#62;= Greater than</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/c-tutorials-cpp/operators-in-c-part-ii/">Operators in C++ Part II</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<h3>Relational Operators</h3>



<p>Relational operators are used to check the relationship between two operands and to compare two or more numbers or even expressions in cases. The return type of a relational operator is a Boolean that is, either True or False (1 or 0).</p>



<figure class="wp-block-table"><table><tbody><tr><td>Operator</td><td>Description</td></tr><tr><td>&gt;</td><td>Greater than</td></tr><tr><td>&lt;</td><td>Less than</td></tr><tr><td>&gt;=</td><td>Greater than or equal to</td></tr><tr><td>&lt;=</td><td>Less than or equal to</td></tr><tr><td>==</td><td>Is equal to</td></tr><tr><td>!=</td><td>Is not equal to</td></tr></tbody></table></figure>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">#include &lt;iostream&gt;
using namespace std;
 
int main()
{
    int a = 4, b = 5;
    cout &lt;&lt; "The value of a == b is " &lt;&lt; (a == b) &lt;&lt; endl;
    cout &lt;&lt; "The value of a &lt; b is " &lt;&lt; (a &lt; b) &lt;&lt; endl;
    cout &lt;&lt; "The value of a &gt; b is " &lt;&lt; (a &gt; b) &lt;&lt; endl;
}
</code></pre>



<p>Output:</p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">The value of a==b is 0
The value of a&lt;b is 1
The value of a&gt;b is 0
</code></pre>



<h3>Logical Operators</h3>



<p>To determine whether an expression is true or false, logical operators are utilised. The logical operators AND, OR, and NOT are the three. Although they are frequently used to compare expressions to determine whether they are satisfactory or not, they may be used to compare Boolean values as well.</p>



<ul><li>AND: it returns true when both operands are true or 1.</li><li>OR: it returns true when either operand is true or 1.</li><li>NOT: it is employed to change the operand&#8217;s logical state and is true when the operand is false.</li></ul>



<figure class="wp-block-table"><table><tbody><tr><td>Operator</td><td>Description</td></tr><tr><td>&amp;&amp;</td><td>AND Operator</td></tr><tr><td>||</td><td>OR Operator</td></tr><tr><td>!</td><td>NOT Operator</td></tr></tbody></table></figure>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">#include &lt;iostream&gt;
using namespace std;
 
int main()
{
    int a = 1, b = 0;
    cout &lt;&lt; "The value of a &amp;&amp; b is " &lt;&lt; (a &amp;&amp; b) &lt;&lt; endl;
    cout &lt;&lt; "The value of a || b is " &lt;&lt; (a || b) &lt;&lt; endl;
    cout &lt;&lt; "The value of !a is " &lt;&lt; (!a) &lt;&lt; endl;
}
</code></pre>



<p>Output:</p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">The value of a &amp;&amp; b is 0
The value of a || b is 1
The value of !a is 0
</code></pre><p>The post <a href="https://studentprojects.in/software-development/cpp/c-tutorials-cpp/operators-in-c-part-ii/">Operators in C++ Part II</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/c-tutorials-cpp/operators-in-c-part-ii/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
