<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Crazy Programmer&#039;s Blog</title>
	<atom:link href="http://crazyprogrammer.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://crazyprogrammer.wordpress.com</link>
	<description>My online note book for C/C++ Programming</description>
	<lastBuildDate>Mon, 19 Sep 2011 12:30:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='crazyprogrammer.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Crazy Programmer&#039;s Blog</title>
		<link>http://crazyprogrammer.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://crazyprogrammer.wordpress.com/osd.xml" title="Crazy Programmer&#039;s Blog" />
	<atom:link rel='hub' href='http://crazyprogrammer.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Print a Diamond shape using array</title>
		<link>http://crazyprogrammer.wordpress.com/2010/04/15/print-a-diamond-shape-using-asterisks-in-c-in-array/</link>
		<comments>http://crazyprogrammer.wordpress.com/2010/04/15/print-a-diamond-shape-using-asterisks-in-c-in-array/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 15:04:24 +0000</pubDate>
		<dc:creator>Dayeen</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://crazyprogrammer.wordpress.com/?p=168</guid>
		<description><![CDATA[Previously I have posted a similar post on how to print diamond shape using asterisks in c/c++ Some of you have asked me if there is any other way to solve this diamond shape asterisks problem. Of course there is. &#8230; <a href="http://crazyprogrammer.wordpress.com/2010/04/15/print-a-diamond-shape-using-asterisks-in-c-in-array/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crazyprogrammer.wordpress.com&amp;blog=9805877&amp;post=168&amp;subd=crazyprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><Font size="+1">Previously I have posted a similar post on <a href="http://crazyprogrammer.wordpress.com/2009/10/30/print-a-diamond-shape-using-asterisks-in-c/">how to print diamond shape using asterisks in c/c++</a><br />
Some of you have asked me if there is any other way to solve this diamond shape asterisks problem. Of course<span id="more-168"></span> there is. You may use array. The array will create a matrix (For an example here we have a 5&#215;5 matrix) .You just need to specify where do you want to put the asterisks that&#8217;s all . The code should be look like this-<br />
</Font></p>
<pre class="brush: css;">
#include&lt;iostream&gt;

using namespace std;

int main()

{

int i,j;

char arr[5][5];

for(i=0;i&lt;5;i++)

  { for(j=0;j&lt;5;j++)

     {
arr[i][j]=' ';

         }
           }

	arr[0][2]='*';

	arr[1][1]='*';

	arr[1][2]='*';

	arr[1][3]='*';

	arr[2][0]='*';

	arr[2][1]='*';

	arr[2][2]='*';

	arr[2][3]='*';

	arr[2][4]='*';

	arr[3][1]='*';

	arr[3][2]='*';

	arr[3][3]='*';

	arr[4][2]='*';

for(i=0;i&lt;5;i++)

     {  cout&lt;&lt;endl;

for( j=0;j&lt;5;j++)

	{   cout&lt;&lt;&quot; &quot;;

	    cout&lt;&lt;arr[i][j];

	     }

               }

	return 0;

}
</pre>
<p><Font size="+1"><br />
Just change the position of the asterisks &#8211; arr[0][2]=&#8217;*'; arr[1][1]=&#8217;*&#8217; &#8230;.. etc. And create a new shape <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
GOOD LUCK !<br />
</Font></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crazyprogrammer.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crazyprogrammer.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crazyprogrammer.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crazyprogrammer.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crazyprogrammer.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crazyprogrammer.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crazyprogrammer.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crazyprogrammer.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crazyprogrammer.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crazyprogrammer.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crazyprogrammer.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crazyprogrammer.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crazyprogrammer.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crazyprogrammer.wordpress.com/168/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crazyprogrammer.wordpress.com&amp;blog=9805877&amp;post=168&amp;subd=crazyprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crazyprogrammer.wordpress.com/2010/04/15/print-a-diamond-shape-using-asterisks-in-c-in-array/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eac327c70cde0458cf5ddfe4951e86b1?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">dayeen</media:title>
		</media:content>
	</item>
		<item>
		<title>How to use infinte loop in c++ programming &#8230;</title>
		<link>http://crazyprogrammer.wordpress.com/2010/04/02/use-infinite-for-loop-have-fun-with-shell-script-c-unix-system-baby-rocker/</link>
		<comments>http://crazyprogrammer.wordpress.com/2010/04/02/use-infinite-for-loop-have-fun-with-shell-script-c-unix-system-baby-rocker/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 08:43:26 +0000</pubDate>
		<dc:creator>Dayeen</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://crazyprogrammer.wordpress.com/?p=147</guid>
		<description><![CDATA[Today I am not gonna solve any text book based programme. Let&#8217;s have some Fun. We are going to write a programme which continuously open &#38; close CD / DVD tray. We&#8217;ll use it to make a &#8216;AUTOMATED MECHANICAL ROCKER&#8217; &#8230; <a href="http://crazyprogrammer.wordpress.com/2010/04/02/use-infinite-for-loop-have-fun-with-shell-script-c-unix-system-baby-rocker/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crazyprogrammer.wordpress.com&amp;blog=9805877&amp;post=147&amp;subd=crazyprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font size="+1">Today I am not gonna solve any text book based programme. Let&#8217;s have some Fun.<br />
We are going to write a programme which continuously open &amp; close CD / DVD tray.</p>
<p>We&#8217;ll use it to make a &#8216;AUTOMATED MECHANICAL ROCKER&#8217; for the babies <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  . Before we proceed, let&#8217;s take a look at the video. You&#8217;ll get a hint that what we are going to do with this programme <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> <span id="more-147"></span></p>
<object width="425" height="334"><param name="movie" value="http://www.dailymotion.com/swf/xcsw91"></param><param name="allowfullscreen" value="true"></param><param name="wmode" value="opaque"></param><embed src="http://www.dailymotion.com/swf/xcsw91" width="425" height="334" allowfullscreen="true" wmode="opaque"></embed></object>
<p>You can do this using c++. Let&#8217;s see-<br />
</font></p>
<pre class="brush: css;">
#include &lt;iostream&gt;
#include &lt;cstdlib&gt;

using namespace std;

int main()
 {

for (;;)
{
    system(&quot;eject&quot;);
    system(&quot;eject -t&quot;);
}
 return 0;
}
</pre>
<p><font size="+1"><br />
This will do it <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>And in the Video, they uses shell script to do that. If you are using linux and want to do this using shell script here is how -</p>
<p>First Run a terminal. Then type-</p>
<p><strong>emacs rocker.sh &amp;</strong></p>
<p>here emacs is the name of the editor. There are lots of other script editor. You can use them too.</p>
<p>And rocker.sh is the name of the file (you may change the name, if you wish).</p>
<p>The above command will open a blank page. There write the code below and save it.</font></p>
<pre class="brush: css;">
#! /bin/sh

while [ 1 = 1 ]
do
      #eject cdrom
      eject

      #pull tray back
      eject -t
done
</pre>
<p><font size="+1"><br />
Done?? <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  Then again go to terminal and type-</p>
<p><strong>sh rocker.sh</strong></p>
<p>this command will run the shell script. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Have Fun!!!! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  </font></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crazyprogrammer.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crazyprogrammer.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crazyprogrammer.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crazyprogrammer.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crazyprogrammer.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crazyprogrammer.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crazyprogrammer.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crazyprogrammer.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crazyprogrammer.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crazyprogrammer.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crazyprogrammer.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crazyprogrammer.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crazyprogrammer.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crazyprogrammer.wordpress.com/147/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crazyprogrammer.wordpress.com&amp;blog=9805877&amp;post=147&amp;subd=crazyprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crazyprogrammer.wordpress.com/2010/04/02/use-infinite-for-loop-have-fun-with-shell-script-c-unix-system-baby-rocker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eac327c70cde0458cf5ddfe4951e86b1?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">dayeen</media:title>
		</media:content>
	</item>
		<item>
		<title>Using C++ to calculate factorial or double factorial of a number</title>
		<link>http://crazyprogrammer.wordpress.com/2009/11/05/c-code-calculate-factorial-or-double-factorial-of-a-number-using-c-programming/</link>
		<comments>http://crazyprogrammer.wordpress.com/2009/11/05/c-code-calculate-factorial-or-double-factorial-of-a-number-using-c-programming/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 04:47:45 +0000</pubDate>
		<dc:creator>Dayeen</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[factorial]]></category>

		<guid isPermaLink="false">http://crazyprogrammer.wordpress.com/?p=83</guid>
		<description><![CDATA[Today I would like to discuss about &#8220;How to calculate the factorial of an integer number&#8221;. In mathematics factorial of a non-negative number is denoted by . Where Example : . In C++ we can calculate it either manually or &#8230; <a href="http://crazyprogrammer.wordpress.com/2009/11/05/c-code-calculate-factorial-or-double-factorial-of-a-number-using-c-programming/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crazyprogrammer.wordpress.com&amp;blog=9805877&amp;post=83&amp;subd=crazyprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font size="+1">Today I would like to discuss about &#8220;How to calculate the factorial of an integer number&#8221;. In mathematics factorial of a non-negative number is denoted by  <img src='http://s0.wp.com/latex.php?latex=n+%21&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='n !' title='n !' class='latex' /> . Where <img src='http://s0.wp.com/latex.php?latex=n+%21+%3D+n++%5Ctimes++%28n-1%29++%5Ctimes++%28n-2%29+.......+%5Ctimes++2++%5Ctimes++1&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='n ! = n  &#92;times  (n-1)  &#92;times  (n-2) ....... &#92;times  2  &#92;times  1' title='n ! = n  &#92;times  (n-1)  &#92;times  (n-2) ....... &#92;times  2  &#92;times  1' class='latex' />  Example : <img src='http://s0.wp.com/latex.php?latex=5+%21+%3D+5++%5Ctimes++4++%5Ctimes++3++%5Ctimes++2++%5Ctimes++1+%3D+120&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='5 ! = 5  &#92;times  4  &#92;times  3  &#92;times  2  &#92;times  1 = 120' title='5 ! = 5  &#92;times  4  &#92;times  3  &#92;times  2  &#92;times  1 = 120' class='latex' />. In C++ we can calculate it <span id="more-83"></span> either manually or calling the factorial function recursively <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  . Here I would like to show how can we write a program that will calculate the factorial of a number . Take a look at the snippets below:</font></p>
<pre class="brush: css;">

#include &lt;iostream&gt;

using namespace std;

//function to calculate factorial

int factorial(int n)
{
 int res = 1,i; 

  for (i=1;i&lt;=n;i++)
{
    res *= i;
  }

  return res;
}

int main( )
{
int n;

 cout &lt;&lt; &quot;Enter the number=&quot;;

  cin &gt;&gt; n; // Take the number as an input
  cout &lt;&lt; n &lt;&lt; &quot;! = &quot; &lt;&lt;factorial(n) &lt;&lt; endl; // output 

  return 0;
}

}
</pre>
<p><font size="+1"><br />
Now what if you want to calculate the double factorial of a number?? What you gonna do? Verrrrrrrry Simple <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  . In math the double factorial of a odd number is defined by <img src='http://s0.wp.com/latex.php?latex=n%21%21%3D+n+++%5Ctimes++%28n-2%29+.......%5Ctimes++5+%5Ctimes++3++%5Ctimes++1&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='n!!= n   &#92;times  (n-2) .......&#92;times  5 &#92;times  3  &#92;times  1' title='n!!= n   &#92;times  (n-2) .......&#92;times  5 &#92;times  3  &#92;times  1' class='latex' /> and for the even number <img src='http://s0.wp.com/latex.php?latex=n%21%21%3D+n++%5Ctimes++%28n-2%29+.......%5Ctimes++6+%5Ctimes++4++%5Ctimes++2&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='n!!= n  &#92;times  (n-2) .......&#92;times  6 &#92;times  4  &#92;times  2' title='n!!= n  &#92;times  (n-2) .......&#92;times  6 &#92;times  4  &#92;times  2' class='latex' />. So we just need to change the for loop of the factorial function . Nothing else. So for double factorial our function will be something like this-</font></p>
<pre class="brush: css;">
int dfact(int n)
{
       int i;double res=1.0;       

       for(i=n;i&gt;=1;i-=2)
{
       res *=i;
       }

       return res;
}
</pre>
<p><font size="+1">Understood??? <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> &#8230;<br />
The code snippets below will calculate both factorial and double factorial of a given number-</font></p>
<pre class="brush: css;">
#include &lt;iostream&gt;

using namespace std;

//factorial function

int factorial(int n)

{ 

 int res = 1,i;  

  for (i=1;i&lt;=n;i++)

 {
   res *= i;
  }

  return res; 

}

//double factorial function

int dfact(int n)

{
       int i;double res=1.0;

       for(i=n;i&gt;=1;i-=2)
       {
       res *=i;
       }

       return res;
}

int main( )
{
int n;

  cout &lt;&lt; &quot;Enter the number=&quot;;

  cin &gt;&gt; n;

  cout &lt;&lt; n &lt;&lt; &quot;! = &quot; &lt;&lt;factorial(n) &lt;&lt; endl; //factorial output
  cout &lt;&lt; n &lt;&lt; &quot;!! = &quot; &lt;&lt;dfact(n) &lt;&lt; endl; //double factorial output 

  return 0;

}
</pre>
<p><font size="+1">That&#8217;s all for now. See Ya!!! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </font> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crazyprogrammer.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crazyprogrammer.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crazyprogrammer.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crazyprogrammer.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crazyprogrammer.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crazyprogrammer.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crazyprogrammer.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crazyprogrammer.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crazyprogrammer.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crazyprogrammer.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crazyprogrammer.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crazyprogrammer.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crazyprogrammer.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crazyprogrammer.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crazyprogrammer.wordpress.com&amp;blog=9805877&amp;post=83&amp;subd=crazyprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crazyprogrammer.wordpress.com/2009/11/05/c-code-calculate-factorial-or-double-factorial-of-a-number-using-c-programming/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eac327c70cde0458cf5ddfe4951e86b1?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">dayeen</media:title>
		</media:content>
	</item>
		<item>
		<title>Print a diamond shape using asterisks in C/C++</title>
		<link>http://crazyprogrammer.wordpress.com/2009/10/30/print-a-diamond-shape-using-asterisks-in-c/</link>
		<comments>http://crazyprogrammer.wordpress.com/2009/10/30/print-a-diamond-shape-using-asterisks-in-c/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 15:44:04 +0000</pubDate>
		<dc:creator>Dayeen</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://crazyprogrammer.wordpress.com/?p=89</guid>
		<description><![CDATA[It is a very common question for both C and C++ programmers that printing a diamond shape using asterisks (*) and this question is asked in almost every freaking semester .There are a lot of different ways to do that. &#8230; <a href="http://crazyprogrammer.wordpress.com/2009/10/30/print-a-diamond-shape-using-asterisks-in-c/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crazyprogrammer.wordpress.com&amp;blog=9805877&amp;post=89&amp;subd=crazyprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font size="+1">It is a very common question for both C and C++ programmers that printing a diamond shape using asterisks (*) and this question is asked in almost every freaking semester <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />   .There are a lot of different ways to do that. But among them I found this one easier.<span id="more-89"></span> Those who likes to use C code for printing diamond  just change the header <span style="color:#993300;">#include&lt;iostream&gt;</span> to <span style="color:#993300;">#include&lt;stdio.h&gt;</span>, <span style="color:#993300;">cout</span> to <span style="color:#993300;">printf</span> and <span style="color:#993300;">cin </span>to <span style="color:#993300;">scanf</span>.Lets start the fun <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> &#8211; </font></p>
<pre class="brush: css;">
#include&lt;iostream&gt;

#include&lt;cstdlib&gt;

using namespace std;

int main()

{

int i=0, j=0, NUM=3;

for(i=-NUM; i&lt;=NUM; i++)

{

for(j=-NUM; j&lt;=NUM; j++)

{

if( abs(i)+abs(j)&lt;=NUM) // Change this condition

 { cout&lt;&lt;&quot;*&quot;; }

else { cout&lt;&lt;&quot; &quot;;}

}

cout&lt;&lt;endl;

}
return 0;
}
</pre>
<p><font size="+1">The above code will prints-</font></p>
<p style="text-align:center;">*<br />
***<br />
*****<br />
*******<br />
*****<br />
***<br />
*</p>
<p><font size="+1">Wait I haven&#8217;t done yet. You can have fun with it. Just change the <span style="color:#993300;">&#8216; if &#8216; </span> condition. You will get new design <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Wanna see???. Lets take a look-</font></p>
<pre class="brush: css;">
if( abs(i)*abs(j)&lt;= NUM)
</pre>
<p><font size="+1">prints-</font></p>
<p style="text-align:center;">***<br />
***<br />
*******<br />
*******<br />
*******<br />
***<br />
***</p>
<pre class="brush: css;">
if( abs(i)+abs(j)==NUM)
</pre>
<p><font size="+1">prints-</font></p>
<p style="text-align:center;">*<br />
*  *<br />
*      *<br />
*          *<br />
*      *<br />
*  *<br />
*</p>
<pre class="brush: css;">
if( abs(i)==abs(j))
</pre>
<p><font size="+1">prints-</font></p>
<p style="text-align:center;">*          *<br />
*      *<br />
*  *<br />
*<br />
*  *<br />
*      *<br />
*          *</p>
<pre class="brush: css;">
if( abs(i)==0||abs(j)==0)
</pre>
<p><font size="+1">prints-</font></p>
<p style="text-align:center;">*<br />
*<br />
*<br />
*******<br />
*<br />
*<br />
*</p>
<pre class="brush: css;">
if( abs(i)&gt;=abs(j))
</pre>
<p><font size="+1">prints-</font></p>
<p style="text-align:center;">*******<br />
*****<br />
***<br />
*<br />
***<br />
*****<br />
*******</p>
<pre class="brush: css;">
if( abs(i)&lt;=abs(j))
</pre>
<p><font size="+1">prints-</font></p>
<p style="text-align:center;">*          *<br />
**      **<br />
***  ***<br />
*******<br />
***  ***<br />
**      **<br />
*          *</p>
<p><font size="+1"><br />
That&#8217;s it. Just change the condition and have fun with it. ENJOY <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
For other method you may check<a href="http://crazyprogrammer.wordpress.com/2010/04/15/print-a-diamond-shape-using-asterisks-in-c-in-array/"> Print a Diamond shape using array</a><br />
 </font></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crazyprogrammer.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crazyprogrammer.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crazyprogrammer.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crazyprogrammer.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crazyprogrammer.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crazyprogrammer.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crazyprogrammer.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crazyprogrammer.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crazyprogrammer.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crazyprogrammer.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crazyprogrammer.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crazyprogrammer.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crazyprogrammer.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crazyprogrammer.wordpress.com/89/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crazyprogrammer.wordpress.com&amp;blog=9805877&amp;post=89&amp;subd=crazyprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crazyprogrammer.wordpress.com/2009/10/30/print-a-diamond-shape-using-asterisks-in-c/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eac327c70cde0458cf5ddfe4951e86b1?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">dayeen</media:title>
		</media:content>
	</item>
		<item>
		<title>Solve a function using C++</title>
		<link>http://crazyprogrammer.wordpress.com/2009/10/09/how-to-solve-a-function-using-c-programming-code-snippet-how-to-write-a-programming-code-solve-a-exponential-trigonometric-function-using-c/</link>
		<comments>http://crazyprogrammer.wordpress.com/2009/10/09/how-to-solve-a-function-using-c-programming-code-snippet-how-to-write-a-programming-code-solve-a-exponential-trigonometric-function-using-c/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 14:21:51 +0000</pubDate>
		<dc:creator>Dayeen</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://crazyprogrammer.wordpress.com/?p=67</guid>
		<description><![CDATA[Let us consider a very simple function . And your assignment is to solve it using c++. How can you do it? Just take a look- What I have done here is that- the above code snippets will takes two &#8230; <a href="http://crazyprogrammer.wordpress.com/2009/10/09/how-to-solve-a-function-using-c-programming-code-snippet-how-to-write-a-programming-code-solve-a-exponential-trigonometric-function-using-c/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crazyprogrammer.wordpress.com&amp;blog=9805877&amp;post=67&amp;subd=crazyprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font size="+1">Let us consider a very simple function <img src='http://s0.wp.com/latex.php?latex=f%28p%2Cq%29%3Dp%2Bq&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='f(p,q)=p+q' title='f(p,q)=p+q' class='latex' /> . And your assignment is to solve it using c++. How can you do it? Just take a look-</font><br />
<span id="more-67"></span></p>
<pre class="brush: css;">
#include&lt;iostream&gt;

using namespace std;

double myfunc(double p,double q)

{

return p+q; //returns the function

}

int main()

{

double p,q;

cout&lt;&lt;&quot;enter the value of p&quot;&lt;&lt;endl;

cin&gt;&gt;p;

cout&lt;&lt;&quot;enter the value of q&quot;&lt;&lt;endl;

cin&gt;&gt;q;

cout&gt;&gt;myfunc(p,q); //Print the output of the function

return 0;

}</pre>
<p><font size="+1"><br />
What I have done here is that- the above code snippets will takes two inputs, &#8216;<span style="color:#993300;">p</span>&#8216; and &#8216;<span style="color:#993300;">q</span>&#8216;. Then  &#8216;<span style="color:#993300;">cout&gt;&gt;myfunc(p,q)</span>&#8216; will searching for a function named &#8216;<span style="color:#993300;">myfunc</span>&#8216; (you can change the name as you wish). When the program finds <span style="color:#993300;">myfunc</span> , it will return the value of  &#8216;<span style="color:#993300;">p+q</span>&#8216;. Isn&#8217;t that easy??</p>
<p>Let&#8217;s try something little harder, shall we? Now we will try to solve a exponential trigonometric function using C++. Upsss!! seems like a hard work. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  But it is not. Take a look. I think you will find it very easy-<!--more--></p>
<p>Let&#8217;s the function is <img src='http://s0.wp.com/latex.php?latex=f%28x%29%3D+sin%28x%29+e%5E%7B-y%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='f(x)= sin(x) e^{-y}' title='f(x)= sin(x) e^{-y}' class='latex' /></Font></p>
<pre class="brush: css;">
#include&lt;iostream&gt;

#include&lt;cmath&gt;

using namespace std;

double f(double x,double y)

{

return sin(x*M_PI)*exp(-y); // the function

}

int main()

{

double p,q;

cout&lt;&lt;&quot;enter the value of p&quot;&lt;&lt;endl;

cin&gt;&gt;p;

cout&lt;&lt;&quot;enter the value of q&quot;&lt;&lt;endl;

cin&gt;&gt;q;

cout&lt;&lt;f(p,q); // print the output

return 0;

}</pre>
<p><font size="+1"><br />
What is the basic difference between these two snippets ?? Take a closer look. I did not change anything but the function. But wait! In my function <span style="color:#993300;">double f(double x,double y)</span> I have used two variables <span style="color:#993300;"> x and y</span>, but when I call the output, I wrote <span style="color:#993300;">cout&lt;&lt;f(p,q);</span> that means I used the variable <span style="color:#993300;">p and q</span>. Did I do something wrong??? <img src='http://s0.wp.com/wp-includes/images/smilies/icon_neutral.gif' alt=':|' class='wp-smiley' />  Nope. This will also gives you the correct answer. And there is another thing, in this case I have used a new header <span style="color:#993300;">#include&lt;cmath&gt;</span>. This will identify <span style="color:#993300;">M_PI</span> and returns the value of <img src='http://s0.wp.com/latex.php?latex=%5Cpi&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;pi' title='&#92;pi' class='latex' /> .<br />
Okey then, lets try these-</p>
<ul>
<li><img src='http://s0.wp.com/latex.php?latex=f%28x%29%3D+x%5E2+%2B4x%2B6&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='f(x)= x^2 +4x+6' title='f(x)= x^2 +4x+6' class='latex' /></li>
<li><img src='http://s0.wp.com/latex.php?latex=f%28x%2Cy%29%3D2x%5E2%2B3xy%2B2&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='f(x,y)=2x^2+3xy+2' title='f(x,y)=2x^2+3xy+2' class='latex' /></li>
<li><img src='http://s0.wp.com/latex.php?latex=f%28x%29%3Dsin%5E2+x%2B3+cos+x%2B2&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='f(x)=sin^2 x+3 cos x+2' title='f(x)=sin^2 x+3 cos x+2' class='latex' /></li>
<li><img src='http://s0.wp.com/latex.php?latex=f%28x%2Cy%29%3D+e%5E%7Bsin+x%7D+%2Bcos+x%2B4&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='f(x,y)= e^{sin x} +cos x+4' title='f(x,y)= e^{sin x} +cos x+4' class='latex' /></li>
</ul>
<p>That&#8217;s all for today . Until next time.  <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </font></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crazyprogrammer.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crazyprogrammer.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crazyprogrammer.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crazyprogrammer.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crazyprogrammer.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crazyprogrammer.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crazyprogrammer.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crazyprogrammer.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crazyprogrammer.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crazyprogrammer.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crazyprogrammer.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crazyprogrammer.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crazyprogrammer.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crazyprogrammer.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crazyprogrammer.wordpress.com&amp;blog=9805877&amp;post=67&amp;subd=crazyprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crazyprogrammer.wordpress.com/2009/10/09/how-to-solve-a-function-using-c-programming-code-snippet-how-to-write-a-programming-code-solve-a-exponential-trigonometric-function-using-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eac327c70cde0458cf5ddfe4951e86b1?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">dayeen</media:title>
		</media:content>
	</item>
		<item>
		<title>Calculating sum of a series of numbers using C</title>
		<link>http://crazyprogrammer.wordpress.com/2009/10/08/calculating-sum-of-a-series-of-numbers-using-c/</link>
		<comments>http://crazyprogrammer.wordpress.com/2009/10/08/calculating-sum-of-a-series-of-numbers-using-c/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 10:01:59 +0000</pubDate>
		<dc:creator>Dayeen</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[series]]></category>
		<category><![CDATA[sum]]></category>

		<guid isPermaLink="false">http://crazyprogrammer.wordpress.com/?p=51</guid>
		<description><![CDATA[If you want to calculate the sum of a series of numbers. Let&#8217;s starts with a very simple series i.e. . Here is how you can do it. This code will ask for the input of your series. By changing &#8230; <a href="http://crazyprogrammer.wordpress.com/2009/10/08/calculating-sum-of-a-series-of-numbers-using-c/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crazyprogrammer.wordpress.com&amp;blog=9805877&amp;post=51&amp;subd=crazyprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font size="+1">If you want to calculate the sum of a series of numbers. Let&#8217;s starts with a very simple series  i.e. <img src='http://s0.wp.com/latex.php?latex=s%3D++1%2B2%2B3%2B........%2Bn&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='s=  1+2+3+........+n' title='s=  1+2+3+........+n' class='latex' /> . Here is how you can do it.</font><span id="more-51"></span></p>
<pre class="brush: css;">
#include&lt;iostream&gt;

using namespace std;

int main()
{

int z,n;

double sum=0.0;

cout&lt;&lt;&quot;input the value of n&quot;&lt;&lt;endl;

cin&gt;&gt;n;

for(z=1;z&lt;=n;z++)

{

sum=sum+ z; //Change this line according to the series

cout&lt;&lt;&quot;the sum of&quot;&lt;&lt;z&lt;&lt;&quot;th term&quot;&lt;&lt;sum&lt;&lt;endl;

}

return 0;

}</pre>
<p><font size="+1"><br />
This code will ask for the input of your series. By changing the line pointed above you calculate different series.</p>
<p>As an example suppose your series is- <img src='http://s0.wp.com/latex.php?latex=s%3D++1%5E2%2B2%5E2%2B3%5E2%2B........%2Bn%5E2&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='s=  1^2+2^2+3^2+........+n^2' title='s=  1^2+2^2+3^2+........+n^2' class='latex' /> .What should you do? Just change that line to -<br />
</font></p>
<pre class="brush: css;">
sum=sum+ z*z;
</pre>
<p><font size="+1"><br />
This will calculate the sum of the series of square numbers.</p>
<p>Again let&#8217;s your series is &#8211; <img src='http://s0.wp.com/latex.php?latex=s%3D+1%2B%5Cfrac%7B1%7D%7B2%7D+%2B%5Cfrac%7B1%7D%7B3%7D+%2B.......+%2B+%5Cfrac%7B1%7D%7Bn%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='s= 1+&#92;frac{1}{2} +&#92;frac{1}{3} +....... + &#92;frac{1}{n}' title='s= 1+&#92;frac{1}{2} +&#92;frac{1}{3} +....... + &#92;frac{1}{n}' class='latex' />. To calculate the result of this series change the line to-<br />
</font></p>
<pre class="brush: css;">
sum=sum+ 1/z;
</pre>
<p><font size="+1"><br />
It will calculate the sum of a series of fraction number. If you understand the above code then you may try to solve these too-</p>
<ul>
<li><img src='http://s0.wp.com/latex.php?latex=s%3D+1%2B%5Cfrac%7B1%7D%7B%7B2%7D%5E3%7D+%2B%5Cfrac%7B1%7D%7B%7B3%7D%5E3%7D+%2B.......+%2B+%5Cfrac%7B1%7D%7B%7Bn%7D%5E3%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='s= 1+&#92;frac{1}{{2}^3} +&#92;frac{1}{{3}^3} +....... + &#92;frac{1}{{n}^3}' title='s= 1+&#92;frac{1}{{2}^3} +&#92;frac{1}{{3}^3} +....... + &#92;frac{1}{{n}^3}' class='latex' /></li>
<li><img src='http://s0.wp.com/latex.php?latex=s%3D++1%2B2%5E2%2B2%5E3%2B........%2B2%5En&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='s=  1+2^2+2^3+........+2^n' title='s=  1+2^2+2^3+........+2^n' class='latex' /></li>
</ul>
<ul>
<li><img src='http://s0.wp.com/latex.php?latex=s%3D+1%2B%5Cfrac%7B1%7D%7B%7B2%7D%7D+%2B%5Cfrac%7B1%7D%7B%7B2%7D%5E2%7D+%2B.......+%2B+%5Cfrac%7B1%7D%7B%7B2%7D%5En%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='s= 1+&#92;frac{1}{{2}} +&#92;frac{1}{{2}^2} +....... + &#92;frac{1}{{2}^n}' title='s= 1+&#92;frac{1}{{2}} +&#92;frac{1}{{2}^2} +....... + &#92;frac{1}{{2}^n}' class='latex' /></li>
</ul>
<p>Hope you will enjoy this. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </font></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crazyprogrammer.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crazyprogrammer.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crazyprogrammer.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crazyprogrammer.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crazyprogrammer.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crazyprogrammer.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crazyprogrammer.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crazyprogrammer.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crazyprogrammer.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crazyprogrammer.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crazyprogrammer.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crazyprogrammer.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crazyprogrammer.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crazyprogrammer.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crazyprogrammer.wordpress.com&amp;blog=9805877&amp;post=51&amp;subd=crazyprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crazyprogrammer.wordpress.com/2009/10/08/calculating-sum-of-a-series-of-numbers-using-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eac327c70cde0458cf5ddfe4951e86b1?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">dayeen</media:title>
		</media:content>
	</item>
		<item>
		<title>A very simple C++ program &#8220;HELLO WORLD&#8221;</title>
		<link>http://crazyprogrammer.wordpress.com/2009/10/07/a-very-simple-c-program-hello-world/</link>
		<comments>http://crazyprogrammer.wordpress.com/2009/10/07/a-very-simple-c-program-hello-world/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 14:00:53 +0000</pubDate>
		<dc:creator>Dayeen</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://crazyprogrammer.wordpress.com/?p=34</guid>
		<description><![CDATA[Today I am going to discuss about one of the most popular and most simple C++ program. This is also my first program in C . This code is soo simple and only gives you one output &#8220;Hello World&#8221; .Let&#8217;s &#8230; <a href="http://crazyprogrammer.wordpress.com/2009/10/07/a-very-simple-c-program-hello-world/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crazyprogrammer.wordpress.com&amp;blog=9805877&amp;post=34&amp;subd=crazyprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font size="+1">Today I am going to discuss about one of the most popular and most simple C++ program. This is also my first program in C . This code is soo simple and only gives you one output &#8220;Hello World&#8221;  .Let&#8217;s starts programming, shall we? <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> -</font><span id="more-34"></span></p>
<pre class="brush: css;">

#include&lt;iostream&gt;

using namespace std;

int main()

{

//This line will tell the compiler what to print
cout&lt;&lt;&quot;Hello World!&quot;&lt;&lt;endl;  

return 0;

}</pre>
<p><font size="+1"><br />
In C++ we use the &#8216;cout&#8217; for printing output and &#8216; cin &#8216; for assigning values in the program. But in C we use &#8216;printf&#8217; and &#8216;scanf&#8217; instead of &#8216;cout&#8217; and &#8216;cin&#8217;.And &#8216;endl&#8217; is used for telling the compiler &#8220;this is the end of line&#8221; .But in C we use &#8220;\n&#8221; to go to a new line. I will show the uses of these in my next posts. Until then see ya <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </font></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crazyprogrammer.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crazyprogrammer.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crazyprogrammer.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crazyprogrammer.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crazyprogrammer.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crazyprogrammer.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crazyprogrammer.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crazyprogrammer.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crazyprogrammer.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crazyprogrammer.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crazyprogrammer.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crazyprogrammer.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crazyprogrammer.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crazyprogrammer.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crazyprogrammer.wordpress.com&amp;blog=9805877&amp;post=34&amp;subd=crazyprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crazyprogrammer.wordpress.com/2009/10/07/a-very-simple-c-program-hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eac327c70cde0458cf5ddfe4951e86b1?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">dayeen</media:title>
		</media:content>
	</item>
		<item>
		<title>Introduction to C/C++ Programming</title>
		<link>http://crazyprogrammer.wordpress.com/2009/10/06/introduction-to-c-programming-history-difference-c-programming/</link>
		<comments>http://crazyprogrammer.wordpress.com/2009/10/06/introduction-to-c-programming-history-difference-c-programming/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 08:28:39 +0000</pubDate>
		<dc:creator>Dayeen</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[History]]></category>

		<guid isPermaLink="false">http://crazyprogrammer.wordpress.com/?p=5</guid>
		<description><![CDATA[A C/C++ program is a collection of commands, which tell the computer to do &#8220;something&#8221;. This collection of commands is usually called C++ source code. C/C++ seems to be a strange name for a programming language . But this strange &#8230; <a href="http://crazyprogrammer.wordpress.com/2009/10/06/introduction-to-c-programming-history-difference-c-programming/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crazyprogrammer.wordpress.com&amp;blog=9805877&amp;post=5&amp;subd=crazyprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font size="+1"><br />
A C/C++ program is a collection of commands, which tell the computer to do &#8220;something&#8221;. This collection of commands is usually called <strong>C++ source code</strong>.</p>
<p>C/C++ seems to be a strange name for a programming language . But this strange sounding language is one of the most popular language today.</p>
<p>C was invented by Dennis Ritchie in 1972 and it was developed <span id="more-5"></span> UNIX operating system. Later Bjarne Stroustrup in 1979 started to work with &#8216;C with Classes&#8217; (which is now known as C++). The first commercial release occurred in October 1985 and in 1983, the name of the language was changed from <em>C with Classes</em> to C++.<img class="alignright" title="Busy in programming" src="http://codecollector.files.wordpress.com/2009/10/programming_cartoon.jpg?w=309&#038;h=335" alt="" width="309" height="335" /></p>
<p>C/C++ primarily used for creating system software. However as it gained popularity it also began to be used for general purpose programming. Today, C and C++ both have proven themselves to be as versatile as they are powerful. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>In short this is the history of C and C++. If anyone wants to read further you can read<a href="http://en.wikipedia.org/wiki/C_(programming_language)#History" target="_blank"> THE HISTORY OF C</a> or <a href="http://en.wikipedia.org/wiki/C++#History" target="_blank">THE HISTORY OF C++ </a>. And the newbies can take a look at the FAQ page for other programming related question .<br />
That&#8217;s all for today. See you later . <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </font></p>
<p><span style="font-size:x-small;"><em>References :</em></span><br />
<span style="font-size:x-small;"><em>1) Teach Yourself C, by- Herbert Schildt .</em></span><br />
<span style="font-size:x-small;"><em>2) Programming in ANSI C, by-E Balagurusamy</em></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crazyprogrammer.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crazyprogrammer.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crazyprogrammer.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crazyprogrammer.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crazyprogrammer.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crazyprogrammer.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crazyprogrammer.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crazyprogrammer.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crazyprogrammer.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crazyprogrammer.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crazyprogrammer.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crazyprogrammer.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crazyprogrammer.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crazyprogrammer.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crazyprogrammer.wordpress.com&amp;blog=9805877&amp;post=5&amp;subd=crazyprogrammer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crazyprogrammer.wordpress.com/2009/10/06/introduction-to-c-programming-history-difference-c-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eac327c70cde0458cf5ddfe4951e86b1?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">dayeen</media:title>
		</media:content>

		<media:content url="http://codecollector.files.wordpress.com/2009/10/programming_cartoon.jpg" medium="image">
			<media:title type="html">Busy in programming</media:title>
		</media:content>
	</item>
	</channel>
</rss>
