<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: 3.7 &#8212; Converting between binary and decimal</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 12:30:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: zkn1729</title>
		<link>http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/comment-page-1/#comment-96380</link>
		<dc:creator>zkn1729</dc:creator>
		<pubDate>Sun, 13 Nov 2011 20:28:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/#comment-96380</guid>
		<description>I got it. http://www.edsim51.com/sampleChapter.pdf (Page 1 and 2.)</description>
		<content:encoded><![CDATA[<p>I got it. <a href="http://www.edsim51.com/sampleChapter.pdf" rel="nofollow">http://www.edsim51.com/sampleChapter.pdf</a> (Page 1 and 2.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zkn1729</title>
		<link>http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/comment-page-1/#comment-96378</link>
		<dc:creator>zkn1729</dc:creator>
		<pubDate>Sun, 13 Nov 2011 01:28:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/#comment-96378</guid>
		<description>There is one thing I&#039;m not getting here. I assume our variable is signed int x=180; It will be stored as 1011 0100. When our program calls x to print to console, how does program decide which one (180 or -76) will be printed to console? (1011 0100 = -76 and 1011 0100 = 180)</description>
		<content:encoded><![CDATA[<p>There is one thing I&#8217;m not getting here. I assume our variable is signed int x=180; It will be stored as 1011 0100. When our program calls x to print to console, how does program decide which one (180 or -76) will be printed to console? (1011 0100 = -76 and 1011 0100 = 180)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zingmars</title>
		<link>http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/comment-page-1/#comment-95444</link>
		<dc:creator>zingmars</dc:creator>
		<pubDate>Sat, 14 May 2011 10:44:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/#comment-95444</guid>
		<description>Wait, so the smallest negative binary number (signed) is 127, or am I missing something?</description>
		<content:encoded><![CDATA[<p>Wait, so the smallest negative binary number (signed) is 127, or am I missing something?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thevergil3</title>
		<link>http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/comment-page-1/#comment-95428</link>
		<dc:creator>thevergil3</dc:creator>
		<pubDate>Sun, 08 May 2011 20:59:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/#comment-95428</guid>
		<description>#include
main()
{int bit=128,num;/* bitwise binary conversion*/
scanf(&quot;%d&quot;,&amp;num);
while(bit&gt;=1)
{if(num&gt;=bit)
{printf(&quot;1&quot;);
num=num-bit;}
else
printf(&quot;0&quot;);
bit=bit/2;}
}</description>
		<content:encoded><![CDATA[<p>#include<br />
main()<br />
{int bit=128,num;/* bitwise binary conversion*/<br />
scanf(&#8220;%d&#8221;,&amp;num);<br />
while(bit&gt;=1)<br />
{if(num&gt;=bit)<br />
{printf(&#8220;1&#8243;);<br />
num=num-bit;}<br />
else<br />
printf(&#8220;0&#8243;);<br />
bit=bit/2;}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PReinie</title>
		<link>http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/comment-page-1/#comment-95344</link>
		<dc:creator>PReinie</dc:creator>
		<pubDate>Wed, 20 Apr 2011 16:57:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/#comment-95344</guid>
		<description>There are 10 kinds of people in this world...

Those who know binary, and those who don&#039;t.

(I didn&#039;t make this one up but it&#039;s great!)

        Phil</description>
		<content:encoded><![CDATA[<p>There are 10 kinds of people in this world&#8230;</p>
<p>Those who know binary, and those who don&#8217;t.</p>
<p>(I didn&#8217;t make this one up but it&#8217;s great!)</p>
<p>        Phil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Koi</title>
		<link>http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/comment-page-1/#comment-89050</link>
		<dc:creator>Koi</dc:creator>
		<pubDate>Sun, 25 Jul 2010 07:00:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/#comment-89050</guid>
		<description>So I tried to create a program to convert a decimal number into a binary number based on your thoughts.  It doesn&#039;t seem to work for some reason.  Here it is:
&lt;pre&gt;#include &lt;iostream&gt;

using namespace std;

int main()
{
    cout &lt;&lt; &quot;Write a number to convert to binary: &quot; &lt;&lt; endl;
    long int nNumber;               //user&#039;s number
    cin &gt;&gt; nNumber;
    cout &lt;&lt; nNumber &lt;&lt; &quot; is&quot; &lt;&lt; endl;
    int nPower(16) ;                //the power of 2 set capped at 16
    while (nPower &gt; 0)
    {
    if (nNumber &gt;= (2^nPower))      //checkes if the number is greater than that bit.
    {
        cout &lt;&lt; 1 &lt;&lt; &quot; &quot;;           // types 1
        nNumber -= (2^nPower);      //deletes that bit from the number
    }
    else
    {
        cout &lt;&lt; 0 &lt;&lt; &quot; &quot;;           // types 0
    }
    nPower -= 1;                    //dletes one from the power of 2 to check with.
    }
    return 0;
}
&lt;/pre&gt;
what&#039;s up with it?</description>
		<content:encoded><![CDATA[<p>So I tried to create a program to convert a decimal number into a binary number based on your thoughts.  It doesn&#8217;t seem to work for some reason.  Here it is:</p>
<pre>#include &lt;iostream&gt;

using namespace std;

int main()
{
    cout &lt;&lt; &quot;Write a number to convert to binary: &quot; &lt;&lt; endl;
    long int nNumber;               //user&#39;s number
    cin &gt;&gt; nNumber;
    cout &lt;&lt; nNumber &lt;&lt; &quot; is&quot; &lt;&lt; endl;
    int nPower(16) ;                //the power of 2 set capped at 16
    while (nPower &gt; 0)
    {
    if (nNumber &gt;= (2^nPower))      //checkes if the number is greater than that bit.
    {
        cout &lt;&lt; 1 &lt;&lt; &quot; &quot;;           // types 1
        nNumber -= (2^nPower);      //deletes that bit from the number
    }
    else
    {
        cout &lt;&lt; 0 &lt;&lt; &quot; &quot;;           // types 0
    }
    nPower -= 1;                    //dletes one from the power of 2 to check with.
    }
    return 0;
}
</pre>
<p>what&#8217;s up with it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gio</title>
		<link>http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/comment-page-1/#comment-83915</link>
		<dc:creator>Gio</dc:creator>
		<pubDate>Sat, 01 May 2010 12:43:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/#comment-83915</guid>
		<description>For all Windows users, the default &quot;Calculator&quot; application can help with conversion: Change the mode to scientific, then, enter the decimal number, then hit &quot;Bin&quot; to convert to binary. Also works in reverse and with Hexadecimal and Octal.</description>
		<content:encoded><![CDATA[<p>For all Windows users, the default &#8220;Calculator&#8221; application can help with conversion: Change the mode to scientific, then, enter the decimal number, then hit &#8220;Bin&#8221; to convert to binary. Also works in reverse and with Hexadecimal and Octal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: earlmw</title>
		<link>http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/comment-page-1/#comment-75233</link>
		<dc:creator>earlmw</dc:creator>
		<pubDate>Fri, 01 Jan 2010 00:23:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/#comment-75233</guid>
		<description>two int main()s, I think you only need the second int main(). You are creating a function before before the int main() where your program begins.</description>
		<content:encoded><![CDATA[<p>two int main()s, I think you only need the second int main(). You are creating a function before before the int main() where your program begins.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Enrique Serrano</title>
		<link>http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/comment-page-1/#comment-66895</link>
		<dc:creator>Enrique Serrano</dc:creator>
		<pubDate>Sat, 22 Aug 2009 23:18:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/#comment-66895</guid>
		<description>This is very cool!  This piece of code works like a charm!  Thank you! I will se this for my gaming and simlation classes!</description>
		<content:encoded><![CDATA[<p>This is very cool!  This piece of code works like a charm!  Thank you! I will se this for my gaming and simlation classes!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alfreda</title>
		<link>http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/comment-page-1/#comment-36812</link>
		<dc:creator>Alfreda</dc:creator>
		<pubDate>Fri, 09 Jan 2009 12:16:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/37-converting-between-binary-and-decimal/#comment-36812</guid>
		<description>I found a website where you could buy doormats with the word &quot;Welcome&quot; printed on them in binary.

I&#039;m guessing it just took the ASCII code for each letter in &quot;Welcome&quot; and converted those numbers to binary, which turns out to be &quot;01110111011001010110110001100011011011110110110101100101&quot;

which was four rows of numbers on the doormat :P

The caption said &quot;Welcome your friends &amp; family into your hi-tech culture!

Lol.</description>
		<content:encoded><![CDATA[<p>I found a website where you could buy doormats with the word &#8220;Welcome&#8221; printed on them in binary.</p>
<p>I&#8217;m guessing it just took the ASCII code for each letter in &#8220;Welcome&#8221; and converted those numbers to binary, which turns out to be &#8220;01110111011001010110110001100011011011110110110101100101&#8243;</p>
<p>which was four rows of numbers on the doormat :P</p>
<p>The caption said &#8220;Welcome your friends &amp; family into your hi-tech culture!</p>
<p>Lol.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

