<?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>operators in c | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/operators-in-c/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:20 +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 III</title>
		<link>https://studentprojects.in/software-development/cpp/c-tutorials-cpp/operators-in-c-part-iii/</link>
					<comments>https://studentprojects.in/software-development/cpp/c-tutorials-cpp/operators-in-c-part-iii/#respond</comments>
		
		<dc:creator><![CDATA[Shubhajna Rai]]></dc:creator>
		<pubDate>Mon, 12 Dec 2022 07:53:00 +0000</pubDate>
				<category><![CDATA[C++ Tutorials]]></category>
		<category><![CDATA[Assigment operator]]></category>
		<category><![CDATA[bitwise operator]]></category>
		<category><![CDATA[operators in c]]></category>
		<guid isPermaLink="false">https://studentprojects.in/?p=9831</guid>

					<description><![CDATA[<p>Bitwise Operators At the bit level, operations are carried out using a bitwise operator. They translate our input values into binary format, process them using the appropriate operator, and output the results. Operator Description &#38; Bitwise AND &#124; Bitwise OR ^ Bitwise XOR ~ Bitwise Complement &#62;&#62; Shift Right Operator &#60;&#60; Shift Left Operator Output:</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/c-tutorials-cpp/operators-in-c-part-iii/">Operators in C++ Part III</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<h3>Bitwise Operators</h3>



<p>At the bit level, operations are carried out using a bitwise operator. They translate our input values into binary format, process them using the appropriate operator, and output the results.</p>



<figure class="wp-block-table"><table><tbody><tr><td>Operator</td><td>Description</td></tr><tr><td>&amp;</td><td>Bitwise AND</td></tr><tr><td>|</td><td>Bitwise OR</td></tr><tr><td>^</td><td>Bitwise XOR</td></tr><tr><td>~</td><td>Bitwise Complement</td></tr><tr><td>&gt;&gt;</td><td>Shift Right Operator</td></tr><tr><td>&lt;&lt;</td><td>Shift Left 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 = 13; //1101
    int b = 5;  //101
    cout &lt;&lt; "The value of a &amp; b is " &lt;&lt; (a &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 ^ b is " &lt;&lt; (a ^ b) &lt;&lt; endl;
    cout &lt;&lt; "The value of ~a is " &lt;&lt; (~a) &lt;&lt; endl;
    cout &lt;&lt; "The value of a &gt;&gt; 2 is " &lt;&lt; (a &gt;&gt; 2) &lt;&lt; endl;
    cout &lt;&lt; "The value of a &lt;&lt; 2 is " &lt;&lt; (a &lt;&lt; 2) &lt;&lt; endl;
}
</code></pre>



<p>Output:</p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">The value of a &amp; b is 5
The value of a | b is 13
The value of a ^ b is 8
The value of ~a is -14
The value of a &gt;&gt; 2 is 3
The value of a &lt;&lt; 2 is 52</code></pre>



<h3>Assignment Operators</h3>



<p>Values are assigned using assignment operators. They will be incorporated into nearly every programme we create.</p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">int a = 0;
int b = 1;</code></pre>



<figure class="wp-block-table"><table><tbody><tr><td>Operator</td><td>Description</td></tr><tr><td>=</td><td>It assigns the right side operand value to the left side operand.</td></tr><tr><td>+=</td><td>It adds the right operand to the left operand and assigns the result to the left operand.</td></tr><tr><td>-=</td><td>It subtracts the right operand from the left operand and assigns the result to the left operand.</td></tr><tr><td>*=</td><td>It multiplies the right operand with the left operand and assigns the result to the left operand.</td></tr><tr><td>/=</td><td>It divides the left operand with the right operand and assigns the result to the left operand.</td></tr></tbody></table></figure>



<h3>Inherent Operator Priority and Associativity</h3>



<p><strong>Operator priority</strong></p>



<p>It assists us in solving an equation by allowing us to distinguish which operator comes before another. Think about the phrase a+b*c. Given that the precedence of the multiplication operator is higher than the precedence of the addition operator, multiplication between a and b will now be completed before the addition operation.</p>



<p><strong>Associativity of operators</strong></p>



<p>When two or more operators with the same precedence are combined in an expression, it aids in solving the expression. It aids in determining whether to begin solving the expression comprising operators with the same precedence from the left to the right or vice versa.</p><p>The post <a href="https://studentprojects.in/software-development/cpp/c-tutorials-cpp/operators-in-c-part-iii/">Operators in C++ Part III</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-iii/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<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[Logical Operators]]></category>
		<category><![CDATA[Relational Operators]]></category>
		<category><![CDATA[operators in c]]></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>
		<item>
		<title>Operators in C++  Part I</title>
		<link>https://studentprojects.in/software-development/cpp/c-tutorials-cpp/operators-in-c-part-i/</link>
					<comments>https://studentprojects.in/software-development/cpp/c-tutorials-cpp/operators-in-c-part-i/#respond</comments>
		
		<dc:creator><![CDATA[Shubhajna Rai]]></dc:creator>
		<pubDate>Sat, 10 Dec 2022 07:46:00 +0000</pubDate>
				<category><![CDATA[C++ Tutorials]]></category>
		<category><![CDATA[Arithmetic operators]]></category>
		<category><![CDATA[operators in c]]></category>
		<guid isPermaLink="false">https://studentprojects.in/?p=9827</guid>

					<description><![CDATA[<p>Operators are unique symbols that are employed to carry out certain tasks or activities. Both unary and binary options are possible. For instance, the binary operator + is used in C++ to accomplish addition when it is placed between two numbers. Operators come in a variety of forms. These are what they are: Arithmetic Operators</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/c-tutorials-cpp/operators-in-c-part-i/">Operators in C++  Part I</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Operators are unique symbols that are employed to carry out certain tasks or activities. Both unary and binary options are possible. For instance, the binary operator + is used in C++ to accomplish addition when it is placed between two numbers. Operators come in a variety of forms. These are what they are:</p>



<h3>Arithmetic Operators</h3>



<p>Mathematical operations like addition, subtraction, etc. are carried out using arithmetic operators. They could be binary or unary. Several of the basic arithmetic operators include</p>



<figure class="wp-block-table"><table><tbody><tr><td>Operation</td><td>Description</td></tr><tr><td>a + b</td><td>Adds a and b</td></tr><tr><td>a &#8211; b</td><td>Subtracts b from a</td></tr><tr><td>a * b</td><td>Multiplies a and b</td></tr><tr><td>a / b</td><td>Divides a by b</td></tr><tr><td>a % b</td><td>Modulus of a and b</td></tr><tr><td>a++</td><td>Post increments a by 1</td></tr><tr><td>a&#8211;&nbsp;</td><td>Post decrements a by 1</td></tr><tr><td>++a</td><td>Pre increments a by 1</td></tr><tr><td>&#8211;a</td><td>Pre decrements a by 1</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 - b is " &lt;&lt; a - 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 / b is " &lt;&lt; a / 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;
    cout &lt;&lt; "The value of a-- is " &lt;&lt; a-- &lt;&lt; endl;
    cout &lt;&lt; "The value of ++a is " &lt;&lt; ++a &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 + b is 9 
The value of a - b is -1
The value of a * b is 20
The value of a / b is 0 
The value of a % b is 4 
The value of a++ is 4   
The value of a-- is 5
The value of ++a is 5
The value of --a is 4
</code></pre><p>The post <a href="https://studentprojects.in/software-development/cpp/c-tutorials-cpp/operators-in-c-part-i/">Operators in C++  Part I</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-i/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Operators in c part 2</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/operators-in-c-part-2/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/operators-in-c-part-2/#respond</comments>
		
		<dc:creator><![CDATA[Shubhajna Rai]]></dc:creator>
		<pubDate>Tue, 25 Oct 2022 07:30:01 +0000</pubDate>
				<category><![CDATA[C Tutorials]]></category>
		<category><![CDATA[bitwise operator]]></category>
		<category><![CDATA[intelligent orperator]]></category>
		<category><![CDATA[operators in c]]></category>
		<guid isPermaLink="false">https://studentprojects.in/?p=9649</guid>

					<description><![CDATA[<p>Intelligent Operators Three logical operators, namely OR, AND, and NOT. Although they are frequently used to compare conditions to determine whether they are satisfied or not, they can be used to compare Boolean values as well.When both operators are true or one, it returns true.When either operator evaluates to true or to one, it returns</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/operators-in-c-part-2/">Operators in c part 2</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Intelligent Operators</p>



<ul><li>Three logical operators, namely OR, AND, and NOT. Although they are frequently used to compare conditions to determine whether they are satisfied or not, they can be used to compare Boolean values as well.When both operators are true or one, it returns true.When either operator evaluates to true or to one, it returns true.NOT: It is employed to change the operand&#8217;s logical state.</li></ul>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" src="https://studentprojects.in/wp-content/uploads/2022/10/image.png" alt="" class="wp-image-9651" width="270" height="192" srcset="https://studentprojects.in/wp-content/uploads/2022/10/image.png 396w, https://studentprojects.in/wp-content/uploads/2022/10/image-300x213.png 300w" sizes="(max-width: 270px) 100vw, 270px" /></figure></div>


<pre class="wp-block-code"><code lang="c" class="language-c">#include &lt;stdio.h&gt;
 int main()
{
    int a = 1;
    int b = 0;
    printf("a or b = %d\n", a || b);
}</code></pre>



<p>Output: a or b = 1</p>



<p>The Bitwise Operators</p>



<ul><li>When executing operations at the bit level, a bitwise operator is utilised. They translate our input values into binary format and then process them using the appropriate operator to produce the desired outcomes.</li></ul>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://studentprojects.in/wp-content/uploads/2022/10/image-1.png" alt="" class="wp-image-9652" width="412" height="169" srcset="https://studentprojects.in/wp-content/uploads/2022/10/image-1.png 673w, https://studentprojects.in/wp-content/uploads/2022/10/image-1-300x123.png 300w" sizes="(max-width: 412px) 100vw, 412px" /></figure></div>


<pre class="wp-block-code"><code lang="c" class="language-c">#include &lt;stdio.h&gt;
 int main()
{
    int a = 2; //10
    int b = 3; //11
    printf("a xor b = %d\n", a ^ b);
}</code></pre>



<p>OUTPUT: a xor b = 1</p>



<p>Operators of assignments</p>



<ul><li>Values are assigned using assignment operators. They will be incorporated into nearly every programme we create.</li><li>int a = 0;</li><li>int b = 1;</li><li>Equal to (=) is the assignment operator here. It is assigning 0 to a and 1 to b in the above example.</li></ul>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://studentprojects.in/wp-content/uploads/2022/10/image-2.png" alt="" class="wp-image-9653" width="469" height="281" srcset="https://studentprojects.in/wp-content/uploads/2022/10/image-2.png 760w, https://studentprojects.in/wp-content/uploads/2022/10/image-2-300x180.png 300w" sizes="(max-width: 469px) 100vw, 469px" /></figure></div><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/operators-in-c-part-2/">Operators in c part 2</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/operators-in-c-part-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is the use of sizeof() operator in C?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/sizeof-operator/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/sizeof-operator/#respond</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Tue, 07 Feb 2012 08:41:28 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[sizeof in c]]></category>
		<category><![CDATA[operators in c]]></category>
		<category><![CDATA[c opertors]]></category>
		<category><![CDATA[sizeof operator]]></category>
		<category><![CDATA[size of]]></category>
		<category><![CDATA[sizeof]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=2653</guid>

					<description><![CDATA[<p>The sizeof operator returns the size in bytes of its operand. Operand may be a variable or data type.</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/sizeof-operator/">What is the use of sizeof() operator in C?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>The sizeof operator returns the size in bytes of its operand. Operand may be a variable or data type.</p>
<p>Here are few examples,</p>
<p>Example 1:</p>
<pre lang="c" escaped="true">
main()
 {
  char c;
 
  printf("%d,%d\n", sizeof c, sizeof(int)); /* returns 1, 4*/
 }
</pre>
<p>Example 2:</p>
<pre lang="c" escaped="true">
(main)
 {
	 struct 
	 {
	   int a;
	   int b;
	 }s;
	
	printf ("% d \ n", sizeof (s)); /* returns 8*/
	}
</pre>
<p>Example 3:</p>
<pre lang="c" escaped="true">
main()
 {
  short array [] = {1, 2, 3, 4, 5};

  short la = sizeof (array) / * returns 10 * /
 }
 </pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/sizeof-operator/">What is the use of sizeof() operator in C?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-faq/sizeof-operator/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
