<?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: 1.6 &#8212; Whitespace and basic formatting</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/16-whitespace-and-basic-formatting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/16-whitespace-and-basic-formatting/</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: WordPress</title>
		<link>http://www.learncpp.com/cpp-tutorial/16-whitespace-and-basic-formatting/comment-page-1/#comment-95586</link>
		<dc:creator>WordPress</dc:creator>
		<pubDate>Sat, 18 Jun 2011 15:44:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=24#comment-95586</guid>
		<description>And just in case you&#039;re wondering, a DOS is a Disk operating system. It is the usually black colored executable that debugs your C++ source code.</description>
		<content:encoded><![CDATA[<p>And just in case you&#8217;re wondering, a DOS is a Disk operating system. It is the usually black colored executable that debugs your C++ source code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WordPress</title>
		<link>http://www.learncpp.com/cpp-tutorial/16-whitespace-and-basic-formatting/comment-page-1/#comment-95585</link>
		<dc:creator>WordPress</dc:creator>
		<pubDate>Sat, 18 Jun 2011 15:42:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=24#comment-95585</guid>
		<description>Write and run a C++ code or open up an existing executable C++ DOS/CLI. Right click it at the start menu dock. Click Defaults. You should be able to work it out from there.</description>
		<content:encoded><![CDATA[<p>Write and run a C++ code or open up an existing executable C++ DOS/CLI. Right click it at the start menu dock. Click Defaults. You should be able to work it out from there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zingmars</title>
		<link>http://www.learncpp.com/cpp-tutorial/16-whitespace-and-basic-formatting/comment-page-1/#comment-95512</link>
		<dc:creator>zingmars</dc:creator>
		<pubDate>Tue, 31 May 2011 11:25:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=24#comment-95512</guid>
		<description>http://pastebin.ca/2072722 (I no longer trust the comment system, so I&#039;m using 3rd party service to host my code. Also I&#039;ve set the link to expire in 2 weeks (just so that you&#039;re warned)).
It worked fine for me (VS2010; removed the stdafx.h #include, because I ticked off the pre-compiled headers).
Enjoy.</description>
		<content:encoded><![CDATA[<p><a href="http://pastebin.ca/2072722" rel="nofollow">http://pastebin.ca/2072722</a> (I no longer trust the comment system, so I&#8217;m using 3rd party service to host my code. Also I&#8217;ve set the link to expire in 2 weeks (just so that you&#8217;re warned)).<br />
It worked fine for me (VS2010; removed the stdafx.h #include, because I ticked off the pre-compiled headers).<br />
Enjoy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dkdae2</title>
		<link>http://www.learncpp.com/cpp-tutorial/16-whitespace-and-basic-formatting/comment-page-1/#comment-95501</link>
		<dc:creator>dkdae2</dc:creator>
		<pubDate>Sun, 29 May 2011 04:26:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=24#comment-95501</guid>
		<description>hi!

i am a newbi here and i am trying to learn C++. i have written a program to calc the simple interest and amount of a given data.

i am using visual C++ express edition and it returns unexpected results though it compiles. please help me understand y.

Code:
// calculating the simple interest for the data from he user
//please help me solve this

#include &quot;stdafx.h&quot;					//since i am using visual C++ 
#include 					//well, iostream is necessary

float si(float a, float b, float c)	//declaring that the data could be in decimals
{
	return a*b*c/100;				//the formula
}

int main()							//main
{
	using namespace std;			

	cout&lt;&lt;&quot;principal&quot;&lt;&gt;p;							//taking the entered value as p
	
	cout&lt;&lt;&quot;time&quot;&lt;&gt;t;
	
	cout&lt;&lt;&quot;rate&quot;&lt;&gt;r;
	
	cout &lt;&lt; &quot;interest=&quot;&lt;&lt;			//printing the interest
	cout &lt;&lt; si(p,t,r) &lt;&lt; endl;		//calling the function
	
	cout &lt;&lt; &quot;amount=&quot;&lt;&lt;				//amount
	cout &lt;&lt; si(p,t,r)+p;			//printing the amount
	return 0;
}

this is what it returns when i run it

for principal=1
time=1
rate=1
it shows
interest=10572ACC0.01
amount=10572ACC1.01

please help me out.
thank you.
a fellow programmer.</description>
		<content:encoded><![CDATA[<p>hi!</p>
<p>i am a newbi here and i am trying to learn C++. i have written a program to calc the simple interest and amount of a given data.</p>
<p>i am using visual C++ express edition and it returns unexpected results though it compiles. please help me understand y.</p>
<p>Code:<br />
// calculating the simple interest for the data from he user<br />
//please help me solve this</p>
<p>#include &#8220;stdafx.h&#8221;					//since i am using visual C++<br />
#include 					//well, iostream is necessary</p>
<p>float si(float a, float b, float c)	//declaring that the data could be in decimals<br />
{<br />
	return a*b*c/100;				//the formula<br />
}</p>
<p>int main()							//main<br />
{<br />
	using namespace std;			</p>
<p>	cout&lt;&lt;&quot;principal&quot;&lt;&gt;p;							//taking the entered value as p</p>
<p>	cout&lt;&lt;&quot;time&quot;&lt;&gt;t;</p>
<p>	cout&lt;&lt;&quot;rate&quot;&lt;&gt;r;</p>
<p>	cout &lt;&lt; &quot;interest=&quot;&lt;&lt;			//printing the interest<br />
	cout &lt;&lt; si(p,t,r) &lt;&lt; endl;		//calling the function</p>
<p>	cout &lt;&lt; &quot;amount=&quot;&lt;&lt;				//amount<br />
	cout &lt;&lt; si(p,t,r)+p;			//printing the amount<br />
	return 0;<br />
}</p>
<p>this is what it returns when i run it</p>
<p>for principal=1<br />
time=1<br />
rate=1<br />
it shows<br />
interest=10572ACC0.01<br />
amount=10572ACC1.01</p>
<p>please help me out.<br />
thank you.<br />
a fellow programmer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leo</title>
		<link>http://www.learncpp.com/cpp-tutorial/16-whitespace-and-basic-formatting/comment-page-1/#comment-94420</link>
		<dc:creator>Leo</dc:creator>
		<pubDate>Thu, 21 Oct 2010 11:28:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=24#comment-94420</guid>
		<description>Well, this is very good. I have a question: Assuming that you have more than one function, main() function should be at the top or not?

&lt;pre&gt;
int doubleVal(x);

int main()
{
	int nCosto	 = 38;
	int ItemsPor     = 34;
	int x;
	cout &lt;&lt; &quot;Give me a number &quot;; 
	cin &gt;&gt; x;

	doubleVal(x);

	cout &lt;&lt; doubleVal(x) &lt;&lt; endl;

        return 0;

}

int doubleVal(int x)
{
	return x * 2;
}
&lt;!--formatted--&gt;&lt;/pre&gt;


Or, it doesn&#039;t matter if it&#039;s at the bottom (since there&#039;s a &quot;Find&quot; dialog box to look for it easily):
&lt;pre&gt;
int doubleVal(int x)
{
	return x * 2;
}

int main()
{
	int nCosto	 = 38;
	int ItemsPor     = 34;
	int x;
	cout &lt;&lt; &quot;Give me a number &quot;; 
	cin &gt;&gt; x;

	doubleVal(x);

	cout &lt;&lt; doubleVal(x) &lt;&lt; endl;

        return 0;

}&lt;!--formatted--&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Well, this is very good. I have a question: Assuming that you have more than one function, main() function should be at the top or not?</p>
<pre>
int doubleVal(x);

int main()
{
	int nCosto	 = 38;
	int ItemsPor     = 34;
	int x;
	cout &lt;&lt; &quot;Give me a number &quot;;
	cin &gt;&gt; x;

	doubleVal(x);

	cout &lt;&lt; doubleVal(x) &lt;&lt; endl;

        return 0;

}

int doubleVal(int x)
{
	return x * 2;
}
<!--formatted--></pre>
<p>Or, it doesn&#8217;t matter if it&#8217;s at the bottom (since there&#8217;s a &#8220;Find&#8221; dialog box to look for it easily):</p>
<pre>
int doubleVal(int x)
{
	return x * 2;
}

int main()
{
	int nCosto	 = 38;
	int ItemsPor     = 34;
	int x;
	cout &lt;&lt; &quot;Give me a number &quot;;
	cin &gt;&gt; x;

	doubleVal(x);

	cout &lt;&lt; doubleVal(x) &lt;&lt; endl;

        return 0;

}<!--formatted--></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: matsolof</title>
		<link>http://www.learncpp.com/cpp-tutorial/16-whitespace-and-basic-formatting/comment-page-1/#comment-91880</link>
		<dc:creator>matsolof</dc:creator>
		<pubDate>Sun, 12 Sep 2010 03:02:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=24#comment-91880</guid>
		<description>I removed the comment, because the code didn&#039;t look as it should and would have been more confusing than helpful.</description>
		<content:encoded><![CDATA[<p>I removed the comment, because the code didn&#8217;t look as it should and would have been more confusing than helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://www.learncpp.com/cpp-tutorial/16-whitespace-and-basic-formatting/comment-page-1/#comment-89275</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Thu, 29 Jul 2010 23:19:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=24#comment-89275</guid>
		<description>Sorry, my mistake. I forgot endl simply moved the cursor down one line of text. I remembered only moments after the countdown ended. Anyways, I&#039;m learning...slowly...but surely. noobs gotta get there eventually.</description>
		<content:encoded><![CDATA[<p>Sorry, my mistake. I forgot endl simply moved the cursor down one line of text. I remembered only moments after the countdown ended. Anyways, I&#8217;m learning&#8230;slowly&#8230;but surely. noobs gotta get there eventually.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://www.learncpp.com/cpp-tutorial/16-whitespace-and-basic-formatting/comment-page-1/#comment-89274</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Thu, 29 Jul 2010 23:05:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=24#comment-89274</guid>
		<description>When is it necessary to have &lt;&lt; endl; ? Will the two following lines of code work the same?

&lt;pre&gt;
cout &lt;&lt; &quot;Hello world!&quot;;
cout &lt;&lt; &quot;Hello world!&quot; &lt;&lt; endl;
&lt;/pre&gt;

I love these tutorials by the way. Thank you!</description>
		<content:encoded><![CDATA[<p>When is it necessary to have &lt;&lt; endl; ? Will the two following lines of code work the same?</p>
<pre>
cout &lt;&lt; &quot;Hello world!&quot;;
cout &lt;&lt; &quot;Hello world!&quot; &lt;&lt; endl;
</pre>
<p>I love these tutorials by the way. Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hele</title>
		<link>http://www.learncpp.com/cpp-tutorial/16-whitespace-and-basic-formatting/comment-page-1/#comment-80244</link>
		<dc:creator>Hele</dc:creator>
		<pubDate>Thu, 11 Mar 2010 00:29:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=24#comment-80244</guid>
		<description>THANKS A LOT for this tutorial :) ...I&#039;m actually having fun! ;)</description>
		<content:encoded><![CDATA[<p>THANKS A LOT for this tutorial :) &#8230;I&#8217;m actually having fun! ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chaospheonix440</title>
		<link>http://www.learncpp.com/cpp-tutorial/16-whitespace-and-basic-formatting/comment-page-1/#comment-77603</link>
		<dc:creator>chaospheonix440</dc:creator>
		<pubDate>Sun, 31 Jan 2010 23:49:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=24#comment-77603</guid>
		<description>This tutorial is great! Thanks for showing how to make code neat. It&#039;s really important and often overlooked.</description>
		<content:encoded><![CDATA[<p>This tutorial is great! Thanks for showing how to make code neat. It&#8217;s really important and often overlooked.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

