<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://gatecse.in/w/index.php?action=history&amp;feed=atom&amp;title=Bitwise_Operators</id>
		<title>Bitwise Operators - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://gatecse.in/w/index.php?action=history&amp;feed=atom&amp;title=Bitwise_Operators"/>
		<link rel="alternate" type="text/html" href="https://gatecse.in/w/index.php?title=Bitwise_Operators&amp;action=history"/>
		<updated>2026-04-16T10:24:58Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.27.0</generator>

	<entry>
		<id>https://gatecse.in/w/index.php?title=Bitwise_Operators&amp;diff=3152&amp;oldid=prev</id>
		<title>Arjun Suresh at 13:55, 26 May 2014</title>
		<link rel="alternate" type="text/html" href="https://gatecse.in/w/index.php?title=Bitwise_Operators&amp;diff=3152&amp;oldid=prev"/>
				<updated>2014-05-26T13:55:54Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;tr style=&#039;vertical-align: top;&#039; lang=&#039;en&#039;&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 13:55, 26 May 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l33&quot; &gt;Line 33:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 33:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; printf(&amp;quot;Enter a number and a power of 2\n&amp;quot;);&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; printf(&amp;quot;Enter a number and a power of 2\n&amp;quot;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; scanf(&amp;quot;%d %d&amp;quot;, &amp;amp;a, &amp;amp;b);&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; scanf(&amp;quot;%d %d&amp;quot;, &amp;amp;a, &amp;amp;b);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; printf(&amp;quot;%d multiplied by %d is\n&amp;quot;, a, a &amp;lt;&amp;lt; b); &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;//&amp;lt;&amp;lt; is usually preferred to * &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; printf(&amp;quot;%d multiplied by &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;2^&lt;/ins&gt;%d is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;%d&lt;/ins&gt;\n&amp;quot;, a&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, b&lt;/ins&gt;, a &amp;lt;&amp;lt; b); &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l45&quot; &gt;Line 45:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 45:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; printf(&amp;quot;Enter a number and a power of 2\n&amp;quot;);&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; printf(&amp;quot;Enter a number and a power of 2\n&amp;quot;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; scanf(&amp;quot;%d %d&amp;quot;, &amp;amp;a, &amp;amp;b);&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; scanf(&amp;quot;%d %d&amp;quot;, &amp;amp;a, &amp;amp;b);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; printf(&amp;quot;%d divided by %d is\n&amp;quot;, a, a &amp;gt;&amp;gt; b); &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;//&amp;gt;&amp;gt; is usually preferred to * &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; printf(&amp;quot;%d divided by &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;2^&lt;/ins&gt;%d is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;%d&lt;/ins&gt;\n&amp;quot;, a&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, b&lt;/ins&gt;, a &amp;gt;&amp;gt; b);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Arjun Suresh</name></author>	</entry>

	<entry>
		<id>https://gatecse.in/w/index.php?title=Bitwise_Operators&amp;diff=3151&amp;oldid=prev</id>
		<title>Arjun Suresh: Created page with &quot;&lt;metadesc&gt;Bitwise Operators in C&lt;/metadesc&gt; ==Bitwise AND, OR, EXOR== &lt;syntaxhighlight lang=&quot;c&quot; name=&quot;bitwise&quot;&gt; #include&lt;stdio.h&gt; int main() {     int a;     printf(&quot;Enter a n...&quot;</title>
		<link rel="alternate" type="text/html" href="https://gatecse.in/w/index.php?title=Bitwise_Operators&amp;diff=3151&amp;oldid=prev"/>
				<updated>2014-05-26T13:51:38Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;metadesc&amp;gt;Bitwise Operators in C&amp;lt;/metadesc&amp;gt; ==Bitwise AND, OR, EXOR== &amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; name=&amp;quot;bitwise&amp;quot;&amp;gt; #include&amp;lt;stdio.h&amp;gt; int main() {     int a;     printf(&amp;quot;Enter a n...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;metadesc&amp;gt;Bitwise Operators in C&amp;lt;/metadesc&amp;gt;&lt;br /&gt;
==Bitwise AND, OR, EXOR==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; name=&amp;quot;bitwise&amp;quot;&amp;gt;&lt;br /&gt;
#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
    int a;&lt;br /&gt;
    printf(&amp;quot;Enter a number\n&amp;quot;);&lt;br /&gt;
    scanf(&amp;quot;%d&amp;quot;, &amp;amp;a);&lt;br /&gt;
    printf(&amp;quot;The third bit (from right) of  %d  is made 0  and we get %d\n&amp;quot;, a, a&amp;amp; (-1&amp;lt;&amp;lt;3 | 11)); // -1 has all bits 1, so -1&amp;lt;&amp;lt;3 will have the rightmost 3 bits 0 and rest 1, and -1&amp;lt;&amp;lt;3 | 11 will have the 3rd bit from right as 0 and all other bits 1 &lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Bitwise NOT==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; name=&amp;quot;bitwisenot&amp;quot;&amp;gt;&lt;br /&gt;
#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
    unsigned int a;&lt;br /&gt;
    printf(&amp;quot;Enter a number\n&amp;quot;);&lt;br /&gt;
    scanf(&amp;quot;%u&amp;quot;, &amp;amp;a);&lt;br /&gt;
    printf(&amp;quot;Negation of %u is %u\n&amp;quot;, a, ~a); //~a will have all bits of a inverted (0&amp;#039;s become 1 and 1&amp;#039;s become 0)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Left Shift==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; name=&amp;quot;leftshift&amp;quot;&amp;gt;&lt;br /&gt;
#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
    int a, b;&lt;br /&gt;
    printf(&amp;quot;Enter a number and a power of 2\n&amp;quot;);&lt;br /&gt;
    scanf(&amp;quot;%d %d&amp;quot;, &amp;amp;a, &amp;amp;b);&lt;br /&gt;
    printf(&amp;quot;%d multiplied by %d is\n&amp;quot;, a, a &amp;lt;&amp;lt; b); //&amp;lt;&amp;lt; is usually preferred to * &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Right Shift==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; name=&amp;quot;rightshift&amp;quot;&amp;gt;&lt;br /&gt;
#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
    int a, b;&lt;br /&gt;
    printf(&amp;quot;Enter a number and a power of 2\n&amp;quot;);&lt;br /&gt;
    scanf(&amp;quot;%d %d&amp;quot;, &amp;amp;a, &amp;amp;b);&lt;br /&gt;
    printf(&amp;quot;%d divided by %d is\n&amp;quot;, a, a &amp;gt;&amp;gt; b); //&amp;gt;&amp;gt; is usually preferred to * &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Template:FBD}}&lt;br /&gt;
&lt;br /&gt;
[[Category: Code]]&lt;/div&gt;</summary>
		<author><name>Arjun Suresh</name></author>	</entry>

	</feed>