<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8806767197976217517</id><updated>2024-12-18T19:31:35.034-08:00</updated><category term="C Programs"/><category term="OOPS"/><category term="C++"/><category term="Inheritance"/><category term="Jquery"/><category term=".net"/><category term="Abstract base classes"/><category term="Armstrong numbers"/><category term="Fibonacci series"/><category term="Friend Function"/><category term="Jquery Slide show"/><category term="JqueryTabs"/><category term="Multiple inheritance"/><category term="Palindrome"/><category term="Pascal triangle"/><category term="Recursion"/><category term="Virtual members"/><category term="Web Programming"/><category term="web Concepts"/><title type='text'>CodeHome</title><subtitle type='html'>Learn the concept of Programming from beginner to Professional ..</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://homeofcode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://homeofcode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09283384045723649184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8806767197976217517.post-7292946255729099663</id><published>2012-04-05T06:23:00.000-07:00</published><updated>2012-04-05T06:23:41.716-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Jquery"/><category scheme="http://www.blogger.com/atom/ns#" term="JqueryTabs"/><title type='text'></title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/Znm_Etj19Fw&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
Download the code form here&lt;a href=&quot;http://uploading.com/files/a8885caf/Tabs.rar/&quot;&gt;Create jquery Tabs in Asp.net&lt;/a&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
smowtion_size = &quot;468x60&quot;;
smowtion_section = &quot;2882246&quot;;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://ads.smowtion.com/ad.js?s=2882246&amp;amp;z=468x60&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://homeofcode.blogspot.com/feeds/7292946255729099663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://homeofcode.blogspot.com/2012/04/download-code-form-here-create-jquery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/7292946255729099663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/7292946255729099663'/><link rel='alternate' type='text/html' href='http://homeofcode.blogspot.com/2012/04/download-code-form-here-create-jquery.html' title=''/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09283384045723649184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/Znm_Etj19Fw/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8806767197976217517.post-4391492769818730985</id><published>2012-03-26T23:03:00.001-07:00</published><updated>2012-03-26T23:04:43.773-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Jquery"/><category scheme="http://www.blogger.com/atom/ns#" term="Jquery Slide show"/><title type='text'>Create Fancy Jquery Slide Show</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: myriad-pro-1, myriad-pro-2, &#39;Lucida Grande&#39;, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-width: 650px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;i&gt;A little while back I did a tutorial on a&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Featured Content Slider. It was neat, but a little limited in customization possibility. The two most requested &lt;a href=&quot;http://homeofcode.blogspot.in/2012/03/create-fancy-jquery-slide-show.html&quot; target=&quot;_blank&quot;&gt;features&lt;/a&gt; were being able to add/remove &quot;panels&quot; and a stop/start button.&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: myriad-pro-1,myriad-pro-2,&#39;Lucida Grande&#39;,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22px; margin: 0px 0px 15px; max-width: 650px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;i&gt;&lt;/i&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;i&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=8806767197976217517&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://css-tricks.com/examples/StartStopSlider/&quot; target=&quot;_blank&quot;&gt;View demo&amp;nbsp;&amp;nbsp;&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: myriad-pro-1,myriad-pro-2,&#39;Lucida Grande&#39;,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22px; margin: 0px 0px 15px; max-width: 650px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;i&gt;&amp;nbsp;&lt;/i&gt;Download the&lt;a href=&quot;https://hotfile.com/dl/150290910/644fa25/StartStopSlider.zip.html&quot; target=&quot;_blank&quot;&gt; source code&lt;/a&gt; here &lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: myriad-pro-1, myriad-pro-2, &#39;Lucida Grande&#39;, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-width: 650px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
smowtion_size = &quot;468x60&quot;;
smowtion_section = &quot;2882246&quot;;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://ads.smowtion.com/ad.js?s=2882246&amp;amp;z=468x60&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://homeofcode.blogspot.com/feeds/4391492769818730985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://homeofcode.blogspot.com/2012/03/create-fancy-jquery-slide-show.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/4391492769818730985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/4391492769818730985'/><link rel='alternate' type='text/html' href='http://homeofcode.blogspot.com/2012/03/create-fancy-jquery-slide-show.html' title='Create Fancy Jquery Slide Show'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09283384045723649184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8806767197976217517.post-6356119953276880563</id><published>2012-03-26T11:24:00.001-07:00</published><updated>2012-03-26T11:25:12.548-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Programs"/><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Fibonacci series"/><title type='text'>Fibonacci series</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: &#39;Lucida Grande&#39;,Arial,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;i&gt;Fibonacci series in c programming: c &lt;/i&gt;program for Fibonacci series without and with&lt;/span&gt; recursion&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: &#39;Lucida Grande&#39;,Arial,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;. Using the code below you can print as many number of terms of series as desired. Numbers of Fibonacci sequence are known as Fibonacci numbers. First few numbers of series are 0, 1, 1, 2, 3, 5, 8 etc, Except first two terms in sequence every other term is the sum of two previous terms, For example 8 = 3 + 5 (addition of 3, 5). This sequence has many applications in mathematics and Computer Science.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: &#39;Lucida Grande&#39;,Arial,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: &#39;Lucida Grande&#39;, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;h2 style=&quot;color: #3b617f;&quot;&gt;

&lt;a href=&quot;http://homeofcode.blogspot.in/2012/03/fibonacci-series.html&quot; target=&quot;_blank&quot;&gt;&lt;i style=&quot;font-weight: normal;&quot;&gt;Fibonacci series&lt;/i&gt;&lt;/a&gt; in c using for loop&lt;/h2&gt;
&lt;div class=&quot;geshifilter&quot; style=&quot;background-color: #f8f8f8; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; color: #222222; display: block; line-height: 1.3; margin-bottom: 0.5em; margin-left: 0.5em; margin-right: 0.5em; margin-top: 0.5em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;
&lt;pre class=&quot;c geshifilter-c&quot; style=&quot;font-family: monospace; font-size: 0.9em; line-height: 1.3; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;coMULTI&quot; style=&quot;color: grey; font-style: italic;&quot;&gt;/* Fibonacci Series c language */&lt;/span&gt;
&lt;span class=&quot;co2&quot; style=&quot;color: #339933;&quot;&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&amp;nbsp;
main&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; n&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; first &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; second &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; next&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; c&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;Enter the number of terms&lt;span class=&quot;es1&quot; style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;scanf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;%d&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&amp;amp;&lt;/span&gt;n&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;First %d terms of Fibonacci series are :-&lt;span class=&quot;es1&quot; style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;n&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; c &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; c &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt; n &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; c&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; c &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
         next &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; c&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt;
      &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
         next &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; first &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;+&lt;/span&gt; second&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
         first &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; second&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
         second &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; next&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;%d&lt;span class=&quot;es1&quot; style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;next&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Output of program:&lt;br /&gt;
&lt;img alt=&quot;Fibonacci series program&quot; height=&quot;225&quot; src=&quot;http://www.programmingsimplified.com/images/c/fibonacci%20series%20program.png&quot; style=&quot;border-width: 0px; padding: 5px;&quot; width=&quot;400&quot; /&gt;&lt;br /&gt;
&lt;h2 id=&quot;recursion&quot; style=&quot;color: #3b617f;&quot;&gt;

Fibonacci series program in c using recursion&lt;/h2&gt;
&lt;div class=&quot;geshifilter&quot; style=&quot;background-color: #f8f8f8; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; color: #222222; display: block; line-height: 1.3; margin-bottom: 0.5em; margin-left: 0.5em; margin-right: 0.5em; margin-top: 0.5em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;
&lt;pre class=&quot;c geshifilter-c&quot; style=&quot;font-family: monospace; font-size: 0.9em; line-height: 1.3; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;co2&quot; style=&quot;color: #339933;&quot;&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; Fibonacci&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
main&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; n&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; i &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; c&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;scanf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;%d&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&amp;amp;&lt;/span&gt;n&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;Fibonacci series&lt;span class=&quot;es1&quot; style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; c &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; c &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&amp;lt;=&lt;/span&gt; n &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; c&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;%d&lt;span class=&quot;es1&quot; style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; Fibonacci&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;i&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
      i&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;++;&lt;/span&gt; 
   &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; Fibonacci&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; n&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; n &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; n &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt;
      &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; Fibonacci&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;n&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;+&lt;/span&gt; Fibonacci&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;n&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt; &lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: &#39;Lucida Grande&#39;,Arial,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
smowtion_size = &quot;468x60&quot;;
smowtion_section = &quot;2882246&quot;;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://ads.smowtion.com/ad.js?s=2882246&amp;amp;z=468x60&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://homeofcode.blogspot.com/feeds/6356119953276880563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://homeofcode.blogspot.com/2012/03/fibonacci-series.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/6356119953276880563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/6356119953276880563'/><link rel='alternate' type='text/html' href='http://homeofcode.blogspot.com/2012/03/fibonacci-series.html' title='Fibonacci series'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09283384045723649184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8806767197976217517.post-790847377448187271</id><published>2012-03-23T20:44:00.003-07:00</published><updated>2012-03-23T20:44:49.829-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Programs"/><category scheme="http://www.blogger.com/atom/ns#" term="Palindrome"/><title type='text'>Palindrome</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: &#39;Lucida Grande&#39;, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;C program for palindrome or palindrome in c programming: palindrome program in c language, c code to check if a string is a palindrome or not and for&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://www.programmingsimplified.com/c-program-find-palindrome#palindrome_number&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #999999; font-family: &#39;Lucida Grande&#39;, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: -webkit-auto; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;palindrome number&lt;/a&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: &#39;Lucida Grande&#39;, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;. This program works as follows :- at first we copy the entered string into a new string, and then we reverse the new string and then compares it with original string. If both of them have same sequence of characters i.e. they are identical then the entered string is a palindrome otherwise not. To perform copy, reverse and compare operations we use strcpy, strrev and strcmp functions of string.h respectively, if you do not wish to use these functions see c programming code for palindrome&lt;/span&gt;without using string functions&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: &#39;Lucida Grande&#39;, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;. Some palindrome strings examples are &quot;dad&quot;, &quot;radar&quot;, &quot;madam&quot; etc.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;pre class=&quot;c geshifilter-c&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: #222222; font-family: monospace; font-size: 0.9em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;co2&quot; style=&quot;color: #339933;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;span class=&quot;co2&quot; style=&quot;color: #339933;&quot;&gt;#include &amp;lt;string.h&amp;gt;&lt;/span&gt;
&amp;nbsp;
main&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;char&lt;/span&gt; a&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; b&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;Enter the string to check if it is a palindrome&lt;span class=&quot;es1&quot; style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;gets&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;a&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;strcpy&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;b&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;a&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   strrev&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;b&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;strcmp&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;a&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;b&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;Entered string is a palindrome.&lt;span class=&quot;es1&quot; style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt;
      &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;Entered string is not a palindrome.&lt;span class=&quot;es1&quot; style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://homeofcode.blogspot.com/feeds/790847377448187271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://homeofcode.blogspot.com/2012/03/palindrome.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/790847377448187271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/790847377448187271'/><link rel='alternate' type='text/html' href='http://homeofcode.blogspot.com/2012/03/palindrome.html' title='Palindrome'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09283384045723649184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8806767197976217517.post-7304896678665553709</id><published>2012-03-23T20:40:00.003-07:00</published><updated>2012-03-23T20:40:46.929-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Programs"/><title type='text'>c program to get ip address</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: &#39;Lucida Grande&#39;, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;This c program prints ip (internet protocol) address of your computer, system function is used to execute the command ipconfig which prints ip address, subnet mask and default gateway. The code given below works for Windows xp and Windows 7. If you are using turbo c compiler then execute program from folder, it may not work when you are working in compiler and press Ctrl+F9 to run your program.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: &#39;Lucida Grande&#39;,Arial,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;pre class=&quot;c geshifilter-c&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: #222222; font-family: monospace; font-size: 0.9em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;co2&quot; style=&quot;color: #339933;&quot;&gt;#include&amp;lt;stdlib.h&amp;gt;&lt;/span&gt;
&amp;nbsp;
main&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;C:&lt;span class=&quot;es1&quot; style=&quot;color: #000099; font-weight: bold;&quot;&gt;\\&lt;/span&gt;Windows&lt;span class=&quot;es1&quot; style=&quot;color: #000099; font-weight: bold;&quot;&gt;\\&lt;/span&gt;System32&lt;span class=&quot;es1&quot; style=&quot;color: #000099; font-weight: bold;&quot;&gt;\\&lt;/span&gt;ipconfig&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;pause&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://homeofcode.blogspot.com/feeds/7304896678665553709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://homeofcode.blogspot.com/2012/03/c-program-to-get-ip-address.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/7304896678665553709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/7304896678665553709'/><link rel='alternate' type='text/html' href='http://homeofcode.blogspot.com/2012/03/c-program-to-get-ip-address.html' title='c program to get ip address'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09283384045723649184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8806767197976217517.post-1069386970441774029</id><published>2012-03-23T20:36:00.002-07:00</published><updated>2012-03-23T20:36:50.698-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Armstrong numbers"/><category scheme="http://www.blogger.com/atom/ns#" term="C Programs"/><title type='text'>armstrong numbers</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;i&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: &#39;Lucida Grande&#39;, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;This program prints armstrong number. In our program we ask the user to enter a number and then we use a loop from one to the entered number and check if it is an armstrong number and if it is then the number is printed on the screen. Remember a number is armstrong if the sum of cubes of individual digits of a number is equal to the number itself. For example 371 is an armstrong number as 3&lt;/span&gt;&lt;sup style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: &#39;Lucida Grande&#39;, Arial, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;3&lt;/sup&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: &#39;Lucida Grande&#39;, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;+ 7&lt;/span&gt;&lt;sup style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: &#39;Lucida Grande&#39;, Arial, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;3&lt;/sup&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: &#39;Lucida Grande&#39;, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;+ 1&lt;/span&gt;&lt;sup style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: &#39;Lucida Grande&#39;, Arial, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;3&lt;/sup&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: &#39;Lucida Grande&#39;, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;= 371. Some other armstrong numbers are 0, 1, 153, 370, 407.&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: &#39;Lucida Grande&#39;,Arial,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;pre class=&quot;c geshifilter-c&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: #222222; font-family: monospace; font-size: 0.9em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;co2&quot; style=&quot;color: #339933;&quot;&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;span class=&quot;co2&quot; style=&quot;color: #339933;&quot;&gt;#include&amp;lt;conio.h&amp;gt;&lt;/span&gt;
&amp;nbsp;
main&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; r&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;long&lt;/span&gt; number &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; c&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; sum &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; temp&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;Enter the maximum range upto which you want to find armstrong numbers &quot;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;scanf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;%ld&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&amp;amp;&lt;/span&gt;number&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;Following armstrong numbers are found from 1 to %ld&lt;span class=&quot;es1&quot; style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;number&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; c &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; c &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&amp;lt;=&lt;/span&gt; number &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; c&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
      temp &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; c&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; temp &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
         r &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; temp&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;nu19&quot; style=&quot;color: purple;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
         sum &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; sum &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;+&lt;/span&gt; r&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt;r&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt;r&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
         temp &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; temp&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; c &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;==&lt;/span&gt; sum &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;%ld&lt;span class=&quot;es1&quot; style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; c&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
      sum &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;getch&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;c geshifilter-c&quot; style=&quot;color: #222222; font-family: monospace; font-size: 0.9em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px; orphans: 2; overflow: auto; padding: 0px; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6DIF2_qBuvpNnnIaedkLFSi4JcWnt85O1xYodP4OsgpsCISMH03UVxacF-hHjL037o0g05aHcLFcJEcEVXcNqkvLjkFfG8Ag8fhhbHt6hz8jVMoRWcZ5TudJhjBiAMbYku0rc8Y5Lxhtp/s1600/armstrong.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;165&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6DIF2_qBuvpNnnIaedkLFSi4JcWnt85O1xYodP4OsgpsCISMH03UVxacF-hHjL037o0g05aHcLFcJEcEVXcNqkvLjkFfG8Ag8fhhbHt6hz8jVMoRWcZ5TudJhjBiAMbYku0rc8Y5Lxhtp/s320/armstrong.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre class=&quot;c geshifilter-c&quot; style=&quot;color: #222222; font-family: monospace; font-size: 0.9em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px; orphans: 2; overflow: auto; padding: 0px; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://homeofcode.blogspot.com/feeds/1069386970441774029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://homeofcode.blogspot.com/2012/03/armstrong-numbers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/1069386970441774029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/1069386970441774029'/><link rel='alternate' type='text/html' href='http://homeofcode.blogspot.com/2012/03/armstrong-numbers.html' title='armstrong numbers'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09283384045723649184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6DIF2_qBuvpNnnIaedkLFSi4JcWnt85O1xYodP4OsgpsCISMH03UVxacF-hHjL037o0g05aHcLFcJEcEVXcNqkvLjkFfG8Ag8fhhbHt6hz8jVMoRWcZ5TudJhjBiAMbYku0rc8Y5Lxhtp/s72-c/armstrong.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8806767197976217517.post-2547742719289807906</id><published>2012-03-23T20:34:00.001-07:00</published><updated>2012-03-23T20:34:26.117-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Programs"/><category scheme="http://www.blogger.com/atom/ns#" term="Pascal triangle"/><title type='text'>Pascal triangle</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;c geshifilter-c&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: #222222; font-family: monospace; font-size: 0.9em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;co2&quot; style=&quot;color: #339933;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;c geshifilter-c&quot; style=&quot;color: #222222; font-family: monospace; font-size: 0.9em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px; orphans: 2; overflow: auto; padding: 0px; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;co2&quot; style=&quot;color: #339933;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: &#39;Lucida Grande&#39;, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Pascal Triangle in c: C program to print Pascal triangle which you might have studied in Binomial Theorem in Mathematics. Number of rows of Pascal triangle to print is entered by the user.&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;c geshifilter-c&quot; style=&quot;color: #222222; font-family: monospace; font-size: 0.9em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px; orphans: 2; overflow: auto; padding: 0px; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: &#39;Lucida Grande&#39;,Arial,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;c geshifilter-c&quot; style=&quot;color: #222222; font-family: monospace; font-size: 0.9em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px; orphans: 2; overflow: auto; padding: 0px; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;co2&quot; style=&quot;color: #339933;&quot;&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;long&lt;/span&gt; factorial&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
main&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; i&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; n&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; c&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;Enter the number of rows you wish to see in pascal triangle&lt;span class=&quot;es1&quot; style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;scanf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;%d&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&amp;amp;&lt;/span&gt;n&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; i &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt; n &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; c &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; c &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; n &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt; i &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; c&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
      &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; c &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; c &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&amp;lt;=&lt;/span&gt; i &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; c&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;%ld &quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;factorial&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;i&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;factorial&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;c&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt;factorial&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;i&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;c&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
      &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;&lt;span class=&quot;es1&quot; style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;long&lt;/span&gt; factorial&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; n&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; c&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;long&lt;/span&gt; result &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; c &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; c &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&amp;lt;=&lt;/span&gt; n &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; c&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
         result &lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; result&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt;c&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw1&quot; style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt; result &lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;c geshifilter-c&quot; style=&quot;color: #222222; font-family: monospace; font-size: 0.9em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px; orphans: 2; overflow: auto; padding: 0px; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;c geshifilter-c&quot; style=&quot;color: #222222; font-family: monospace; font-size: 0.9em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px; orphans: 2; overflow: auto; padding: 0px; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;c geshifilter-c&quot; style=&quot;color: #222222; font-family: monospace; font-size: 0.9em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px; orphans: 2; overflow: auto; padding: 0px; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;Output  &lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;c geshifilter-c&quot; style=&quot;color: #222222; font-family: monospace; font-size: 0.9em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px; orphans: 2; overflow: auto; padding: 0px; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;c geshifilter-c&quot; style=&quot;color: #222222; font-family: monospace; font-size: 0.9em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px; orphans: 2; overflow: auto; padding: 0px; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;   1
  1 1
 1 2 1
1 3 3 1&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://homeofcode.blogspot.com/feeds/2547742719289807906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://homeofcode.blogspot.com/2012/03/pascal-triangle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/2547742719289807906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/2547742719289807906'/><link rel='alternate' type='text/html' href='http://homeofcode.blogspot.com/2012/03/pascal-triangle.html' title='Pascal triangle'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09283384045723649184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8806767197976217517.post-6235796372570037887</id><published>2012-03-23T10:17:00.001-07:00</published><updated>2012-03-23T10:17:28.856-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="OOPS"/><category scheme="http://www.blogger.com/atom/ns#" term="Recursion"/><title type='text'>Recursion</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: verdana, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Recursion is a programming technique that allows the programmer to express operations in terms of themselves. In C++, this takes the form of a function that calls itself. A useful way to think of recursive functions is to imagine them as a process being performed where one of the instructions is to &quot;repeat the process&quot;. This makes it sound very similar to a loop because it repeats the same code, and in some ways it&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;em style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: verdana, sans-serif; font-size: 12px; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;is&lt;/em&gt;&lt;/i&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: verdana, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;similar to looping.&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: verdana,sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;On the other hand, recursion makes it easier to express ideas in which the result of the recursive call is necessary to complete the task. Of course, it must be possible for the &quot;process&quot; to sometimes be completed without the recursive call. One simple example is the idea of building a wall that is ten feet high; if I want to build a ten foot high wall, then I will first build a 9 foot high wall, and then add an extra foot of bricks. Conceptually, this is like saying the &quot;build wall&quot; function takes a height and if that height is greater than one, first calls itself to build a lower wall, and then adds one a foot of bricks.&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: verdana, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;A simple example of recursion would be:&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;example&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #ffffcc; border-bottom-color: rgb(0, 0, 0); border-bottom-style: dashed; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(0, 0, 0); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(0, 0, 0); border-right-style: dashed; border-right-width: 1px; border-style: initial; border-top-color: rgb(0, 0, 0); border-top-style: dashed; border-top-width: 1px; border-width: initial; color: black; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; padding-bottom: 8px; padding-left: 8px; padding-right: 8px; padding-top: 8px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; width: auto; word-spacing: 0px;&quot;&gt;void recurse()
{
  recurse(); //Function calls itself
}

int main()
{
  recurse(); //Sets off the recursion
}
&lt;/pre&gt;
&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: verdana, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;This program will not continue forever, however. The computer keeps function calls on a stack and once too many are called without ending, the program will crash. Why not write a program to see how many times the function is called before the program terminates?&lt;/span&gt;&lt;pre class=&quot;example&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #ffffcc; border-bottom-color: rgb(0, 0, 0); border-bottom-style: dashed; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(0, 0, 0); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(0, 0, 0); border-right-style: dashed; border-right-width: 1px; border-style: initial; border-top-color: rgb(0, 0, 0); border-top-style: dashed; border-top-width: 1px; border-width: initial; color: black; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; padding-bottom: 8px; padding-left: 8px; padding-right: 8px; padding-top: 8px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; width: auto; word-spacing: 0px;&quot;&gt;#include &amp;lt;iostream&amp;gt;

using namespace std;

void recurse ( int count ) // Each call gets its own count
{
  cout&amp;lt;&amp;lt; count &amp;lt;&amp;lt;&quot;\n&quot;;
  // It is not necessary to increment count since each function&#39;s
  //  variables are separate (so each count will be initialized one greater)
  recurse ( count + 1 );
}

int main()
{
  recurse ( 1 ); //First function call, so it starts at one        
}
&lt;/pre&gt;
&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: verdana, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;This simple program will show the number of times the recurse function has been called by initializing each individual function call&#39;s count variable one greater than it was previous by passing in count + 1. Keep in mind, it is not a function restarting itself, it is hundreds of functions that are each unfinished with the last one calling a new recurse function.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: verdana, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: verdana, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: verdana, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It can be thought of like the Russian dolls that always have a smaller doll inside. Each doll calls another doll, and you can think of the size being a counter variable that is being decremented by one.&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://homeofcode.blogspot.com/feeds/6235796372570037887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://homeofcode.blogspot.com/2012/03/recursion.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/6235796372570037887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/6235796372570037887'/><link rel='alternate' type='text/html' href='http://homeofcode.blogspot.com/2012/03/recursion.html' title='Recursion'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09283384045723649184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8806767197976217517.post-3728732544577383159</id><published>2012-03-22T23:15:00.001-07:00</published><updated>2012-03-22T23:15:47.866-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><category scheme="http://www.blogger.com/atom/ns#" term="web Concepts"/><category scheme="http://www.blogger.com/atom/ns#" term="Web Programming"/><title type='text'>.Net Basic</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
   &lt;w:UseFELayout/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-fareast-font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;&lt;b&gt;What is .net&amp;nbsp; &lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;The .NET languages: These
include Visual Basic, C#, F#, and C++. &lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;i&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;The Common Language Runtime&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 9.0pt;&quot;&gt; (CLR): This is the engine that executes all .NET
programs and &lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;provides automatic services
for these applications, such as security checking, memory &lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;management, and optimization.&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;The .NET Framework class library:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 9.0pt;&quot;&gt; The class library collects thousands of pieces of
prebuilt &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;functionality that you can
“snap in” to your applications. These features are sometimes organized &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;into technology sets, such as
ADO.NET (the technology for creating database applications) and &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;Windows Presentation
Foundation (WPF, the technology for creating desktop user interfaces). &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;ASP.NET&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;: This
is the engine that hosts the web applications you create with .NET, and
supports &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;almost any feature from the
.NET Framework class library. ASP.NET also includes a set of web-&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;specific services, such as
secure authentication and data storage. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;Visual Studio&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;:
This optional development tool contains a rich set of productivity and
debugging &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;features. Visual Studio
includes the complete .NET Framework, so you won’t need to download&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;it separately. Sometimes the
division between these components isn’t clear. For example, the term ASP.NET is
&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;sometimes used in a narrow
sense to refer to the portion of the .NET class library used to design web &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;pages. On the other hand,
ASP.NET also refers to the whole topic of .NET web applications, which &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;includes .NET languages and
many fundamental pieces of the class library that aren’t web-specific. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;(That’s generally the way we
use the term in this book. Our exhaustive examination of ASP.NET includes &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9.0pt;&quot;&gt;.NET basics, the C# language,
and topics that any .NET developer could use, such as component-based p&lt;/span&gt;rogramming
and database access.)&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibYZBMq2kC2zqtWK6_Xs12pj-3PTzgX5jIytnJkgNq0GiARHjBQMPJCoa8d9e_pb2xVmlEDzmpLu9PV3AFndcBRQ0INq2oEa-s3XM73AJcyVve9pUGkbIc5oitPg-0apY7_uBjjky7xaoG/s1600/serverside.bmp&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;162&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibYZBMq2kC2zqtWK6_Xs12pj-3PTzgX5jIytnJkgNq0GiARHjBQMPJCoa8d9e_pb2xVmlEDzmpLu9PV3AFndcBRQ0INq2oEa-s3XM73AJcyVve9pUGkbIc5oitPg-0apY7_uBjjky7xaoG/s320/serverside.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&amp;nbsp;&lt;i&gt;&lt;u&gt;&lt;b&gt;Server-Side Programming &lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;Early web development platforms had two key problems. First, they didn’t always scale well. As a result, &lt;br /&gt;popular websites would struggle to keep up with the demand of too many simultaneous users, &lt;br /&gt;eventually crashing or slowing to a crawl. Second, they provided little more than a bare-bones &lt;br /&gt;programming environment. If you wanted higher-level features, such as the ability to authenticate users, &lt;br /&gt;store personalized information, or display records you’ve retrieved from a database, you needed to write &lt;br /&gt;pages of code from scratch. Building a web application this way is tedious and &lt;br /&gt;error-prone. &lt;br /&gt;To counter these problems, Microsoft created higher-level development platforms—first ASP and &lt;br /&gt;then ASP.NET. Both of these technologies allow developers to program dynamic web pages without &lt;br /&gt;worrying about the low-level implementation details. For that reason, both platforms have been &lt;br /&gt;incredibly successful. &lt;br /&gt;&amp;nbsp;The original ASP platform garnered a huge audience of nearly 1 million developers, becoming far &lt;br /&gt;more popular than even Microsoft anticipated. It wasn’t long before it was being wedged into all sorts of &lt;br /&gt;unusual places, including mission-critical business applications and highly trafficked e-commerce sites. Because ASP wasn’t designed with these uses in mind, performance, security, and &lt;br /&gt;configuration problems soon appeared. &lt;br /&gt;That’s where ASP.NET comes into the picture. ASP.NET was developed as an industrial-strength &lt;br /&gt;web application framework that could address the limitations of ASP. Compared to classic ASP, ASP.NET &lt;br /&gt;offers better performance, better design tools, and a rich set of ready-made features. ASP.NET was wildly &lt;br /&gt;popular from the moment it was released—in fact, it was put to work in dozens of large-scale &lt;br /&gt;commercial websites while still in beta.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglx00BgTjdrqctYHyv1XGBnz6TTEYK8ipThwaVOloC-itURDYsFtQSwE8eCxZvVUpgmdnNsPw9Z8aSIKEQKrq8izY9wap2Bn1-hudMp5RIHXm5mljZn8FQIIZbgvTiTxfXKAvg76k9Vjnb/s1600/clientside.bmp&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;157&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglx00BgTjdrqctYHyv1XGBnz6TTEYK8ipThwaVOloC-itURDYsFtQSwE8eCxZvVUpgmdnNsPw9Z8aSIKEQKrq8izY9wap2Bn1-hudMp5RIHXm5mljZn8FQIIZbgvTiTxfXKAvg76k9Vjnb/s320/clientside.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;u&gt;&lt;i&gt;&lt;b&gt;Client-Side Programming &lt;/b&gt;&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;At the same time that server-side web development was moving through an alphabet soup of &lt;br /&gt;technologies, a new type of programming was gaining popularity. Developers began to experiment with &lt;br /&gt;the different ways they could enhance web pages by embedding miniature applets built with JavaScript, &lt;br /&gt;ActiveX, Java, and Flash into web pages. These client-side technologies don’t involve any server &lt;br /&gt;processing. Instead, the complete application is downloaded to the client browser, which executes it &lt;br /&gt;locally. &lt;br /&gt;The greatest problem with client-side technologies is that they aren’t supported equally by all &lt;br /&gt;browsers and operating systems. One of the reasons that web development is so popular in the first &lt;br /&gt;place is because web applications don’t require setup CDs, downloads, client-side configuration, and &lt;br /&gt;other tedious (and error-prone) deployment steps. Instead, a web application can be used on any &lt;br /&gt;computer that has Internet access. But when developers use client-side technologies, they encounter a &lt;br /&gt;few familiar headaches. Suddenly, cross-browser compatibility becomes a problem. Developers are &lt;br /&gt;forced to test their websites with different operating systems and browsers and to deal with a wide range &lt;br /&gt;of browser quirks, bugs, and legacy behaviors. In other words, the client-side model sacrifices some of &lt;br /&gt;the most important benefits of web development. &lt;br /&gt;For that reason, ASP.NET is designed first and foremost as a server-side technology. All ASP.NET &lt;br /&gt;code executes on the server. When the code is finished executing, the user receives an ordinary HTML &lt;br /&gt;page, which can be viewed in any browser. Figure 1-3 shows the difference between the server-side and &lt;br /&gt;client-side models. &lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://homeofcode.blogspot.com/feeds/3728732544577383159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://homeofcode.blogspot.com/2012/03/net-basic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/3728732544577383159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/3728732544577383159'/><link rel='alternate' type='text/html' href='http://homeofcode.blogspot.com/2012/03/net-basic.html' title='.Net Basic'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09283384045723649184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibYZBMq2kC2zqtWK6_Xs12pj-3PTzgX5jIytnJkgNq0GiARHjBQMPJCoa8d9e_pb2xVmlEDzmpLu9PV3AFndcBRQ0INq2oEa-s3XM73AJcyVve9pUGkbIc5oitPg-0apY7_uBjjky7xaoG/s72-c/serverside.bmp" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8806767197976217517.post-2977275686064908401</id><published>2012-03-22T22:37:00.001-07:00</published><updated>2012-03-22T22:37:18.004-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Abstract base classes"/><category scheme="http://www.blogger.com/atom/ns#" term="OOPS"/><title type='text'>Abstract base classes</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3&gt;
&lt;br /&gt;&lt;/h3&gt;
&lt;i&gt;Abstract base classes are something very similar to our &lt;tt&gt;CPolygon&lt;/tt&gt; class of our previous example. The only difference is that in our previous example we have defined a valid &lt;tt&gt;area()&lt;/tt&gt; function with a minimal functionality for objects that were of class &lt;tt&gt;CPolygon&lt;/tt&gt; (like the object &lt;tt&gt;poly&lt;/tt&gt;), whereas in an abstract base classes we could leave that &lt;tt&gt;area()&lt;/tt&gt; member function without implementation at all. This is done by appending &lt;tt&gt;=0&lt;/tt&gt; (equal to zero) to the function declaration. &lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
An abstract base CPolygon class could look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;auto&quot;&gt;
&lt;table class=&quot;snippet&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;1
2
3
4
5
6
7
8
9&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;&lt;cite&gt;// abstract class CPolygon&lt;/cite&gt;
&lt;var&gt;class&lt;/var&gt; CPolygon {
  &lt;var&gt;protected&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; width, height;
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;void&lt;/var&gt; set_values (&lt;var&gt;int&lt;/var&gt; a, &lt;var&gt;int&lt;/var&gt; b)
      { width=a; height=b; }
    &lt;var&gt;virtual&lt;/var&gt; &lt;var&gt;int&lt;/var&gt; area () =0;
};&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Notice how we appended &lt;tt&gt;=0&lt;/tt&gt; to &lt;tt&gt;virtual int area ()&lt;/tt&gt; instead of specifying an implementation for the function. This type of function is called a &lt;i&gt;pure virtual function&lt;/i&gt;, and all classes that contain at least one pure virtual function are &lt;i&gt;abstract base classes&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
The main difference between an abstract base class and a regular 
polymorphic class is that because in abstract base classes at least one 
of its members lacks implementation we cannot create instances (objects)
 of it.&lt;br /&gt;
&lt;br /&gt;
But a class that cannot instantiate objects is not totally useless. We 
can create pointers to it and take advantage of all its polymorphic 
abilities. Therefore a declaration like: &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;auto&quot;&gt;
&lt;table class=&quot;snippet&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;CPolygon poly;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
would not be valid for the abstract base class we have just declared, 
because tries to instantiate an object. Nevertheless, the following 
pointers:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;auto&quot;&gt;
&lt;table class=&quot;snippet&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;1
2&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;CPolygon * ppoly1;
CPolygon * ppoly2;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
would be perfectly valid.&lt;br /&gt;
&lt;br /&gt;
This is so for as long as &lt;tt&gt;CPolygon&lt;/tt&gt; includes a pure virtual 
function and therefore it&#39;s an abstract base class. However, pointers to
 this abstract base class can be used to point to objects of derived 
classes.&lt;br /&gt;
&lt;br /&gt;
Here you have the complete example: &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;auto&quot;&gt;
&lt;table class=&quot;split&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;&lt;cite&gt;// abstract base class&lt;/cite&gt;
&lt;dfn&gt;#include &amp;lt;iostream&amp;gt;&lt;/dfn&gt;
&lt;var&gt;using&lt;/var&gt; &lt;var&gt;namespace&lt;/var&gt; std;

&lt;var&gt;class&lt;/var&gt; CPolygon {
  &lt;var&gt;protected&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; width, height;
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;void&lt;/var&gt; set_values (&lt;var&gt;int&lt;/var&gt; a, &lt;var&gt;int&lt;/var&gt; b)
      { width=a; height=b; }
    &lt;var&gt;virtual&lt;/var&gt; &lt;var&gt;int&lt;/var&gt; area (&lt;var&gt;void&lt;/var&gt;) =0;
  };

&lt;var&gt;class&lt;/var&gt; CRectangle: &lt;var&gt;public&lt;/var&gt; CPolygon {
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; area (&lt;var&gt;void&lt;/var&gt;)
      { &lt;var&gt;return&lt;/var&gt; (width * height); }
  };

&lt;var&gt;class&lt;/var&gt; CTriangle: &lt;var&gt;public&lt;/var&gt; CPolygon {
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; area (&lt;var&gt;void&lt;/var&gt;)
      { &lt;var&gt;return&lt;/var&gt; (width * height / 2); }
  };

&lt;var&gt;int&lt;/var&gt; main () {
  CRectangle rect;
  CTriangle trgl;
  CPolygon * ppoly1 = &amp;amp;rect;
  CPolygon * ppoly2 = &amp;amp;trgl;
  ppoly1-&amp;gt;set_values (4,5);
  ppoly2-&amp;gt;set_values (4,5);
  cout &amp;lt;&amp;lt; ppoly1-&amp;gt;area() &amp;lt;&amp;lt; endl;
  cout &amp;lt;&amp;lt; ppoly2-&amp;gt;area() &amp;lt;&amp;lt; endl;
  &lt;var&gt;return&lt;/var&gt; 0;
}&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;output&quot;&gt;&lt;pre&gt;&lt;samp&gt;20
10&lt;/samp&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
If you review the program you will notice that we refer to objects of 
different but related classes using a unique type of pointer (&lt;tt&gt;CPolygon*&lt;/tt&gt;). This can be tremendously useful. For example, now we can create a function member of the abstract base class &lt;tt&gt;CPolygon&lt;/tt&gt; that is able to print on screen the result of the &lt;tt&gt;area()&lt;/tt&gt; function even though &lt;tt&gt;CPolygon&lt;/tt&gt; itself has no implementation for this function:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;auto&quot;&gt;
&lt;table class=&quot;split&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;&lt;cite&gt;// pure virtual members can be called&lt;/cite&gt;
&lt;cite&gt;// from the abstract base class&lt;/cite&gt;
&lt;dfn&gt;#include &amp;lt;iostream&amp;gt;&lt;/dfn&gt;
&lt;var&gt;using&lt;/var&gt; &lt;var&gt;namespace&lt;/var&gt; std;

&lt;var&gt;class&lt;/var&gt; CPolygon {
  &lt;var&gt;protected&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; width, height;
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;void&lt;/var&gt; set_values (&lt;var&gt;int&lt;/var&gt; a, &lt;var&gt;int&lt;/var&gt; b)
      { width=a; height=b; }
    &lt;var&gt;virtual&lt;/var&gt; &lt;var&gt;int&lt;/var&gt; area (&lt;var&gt;void&lt;/var&gt;) =0;
    &lt;var&gt;void&lt;/var&gt; printarea (&lt;var&gt;void&lt;/var&gt;)
      { cout &amp;lt;&amp;lt; &lt;var&gt;this&lt;/var&gt;-&amp;gt;area() &amp;lt;&amp;lt; endl; }
  };

&lt;var&gt;class&lt;/var&gt; CRectangle: &lt;var&gt;public&lt;/var&gt; CPolygon {
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; area (&lt;var&gt;void&lt;/var&gt;)
      { &lt;var&gt;return&lt;/var&gt; (width * height); }
  };

&lt;var&gt;class&lt;/var&gt; CTriangle: &lt;var&gt;public&lt;/var&gt; CPolygon {
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; area (&lt;var&gt;void&lt;/var&gt;)
      { &lt;var&gt;return&lt;/var&gt; (width * height / 2); }
  };

&lt;var&gt;int&lt;/var&gt; main () {
  CRectangle rect;
  CTriangle trgl;
  CPolygon * ppoly1 = &amp;amp;rect;
  CPolygon * ppoly2 = &amp;amp;trgl;
  ppoly1-&amp;gt;set_values (4,5);
  ppoly2-&amp;gt;set_values (4,5);
  ppoly1-&amp;gt;printarea();
  ppoly2-&amp;gt;printarea();
  &lt;var&gt;return&lt;/var&gt; 0;
}&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;output&quot;&gt;&lt;pre&gt;&lt;samp&gt;20
10&lt;/samp&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Virtual members and abstract classes grant C++ the polymorphic 
characteristics that make object-oriented programming such a useful 
instrument in big projects. Of course, we have seen very simple uses of 
these features, but these features can be applied to arrays of objects 
or dynamically allocated objects.&lt;br /&gt;
&lt;br /&gt;
Let&#39;s end with the same example again, but this time with objects that are dynamically allocated:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;auto&quot;&gt;
&lt;table class=&quot;split&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;&lt;cite&gt;// dynamic allocation and polymorphism&lt;/cite&gt;
&lt;dfn&gt;#include &amp;lt;iostream&amp;gt;&lt;/dfn&gt;
&lt;var&gt;using&lt;/var&gt; &lt;var&gt;namespace&lt;/var&gt; std;

&lt;var&gt;class&lt;/var&gt; CPolygon {
  &lt;var&gt;protected&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; width, height;
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;void&lt;/var&gt; set_values (&lt;var&gt;int&lt;/var&gt; a, &lt;var&gt;int&lt;/var&gt; b)
      { width=a; height=b; }
    &lt;var&gt;virtual&lt;/var&gt; &lt;var&gt;int&lt;/var&gt; area (&lt;var&gt;void&lt;/var&gt;) =0;
    &lt;var&gt;void&lt;/var&gt; printarea (&lt;var&gt;void&lt;/var&gt;)
      { cout &amp;lt;&amp;lt; &lt;var&gt;this&lt;/var&gt;-&amp;gt;area() &amp;lt;&amp;lt; endl; }
  };

&lt;var&gt;class&lt;/var&gt; CRectangle: &lt;var&gt;public&lt;/var&gt; CPolygon {
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; area (&lt;var&gt;void&lt;/var&gt;)
      { &lt;var&gt;return&lt;/var&gt; (width * height); }
  };

&lt;var&gt;class&lt;/var&gt; CTriangle: &lt;var&gt;public&lt;/var&gt; CPolygon {
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; area (&lt;var&gt;void&lt;/var&gt;)
      { &lt;var&gt;return&lt;/var&gt; (width * height / 2); }
  };

&lt;var&gt;int&lt;/var&gt; main () {
  CPolygon * ppoly1 = &lt;var&gt;new&lt;/var&gt; CRectangle;
  CPolygon * ppoly2 = &lt;var&gt;new&lt;/var&gt; CTriangle;
  ppoly1-&amp;gt;set_values (4,5);
  ppoly2-&amp;gt;set_values (4,5);
  ppoly1-&amp;gt;printarea();
  ppoly2-&amp;gt;printarea();
  &lt;var&gt;delete&lt;/var&gt; ppoly1;
  &lt;var&gt;delete&lt;/var&gt; ppoly2;
  &lt;var&gt;return&lt;/var&gt; 0;
}&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;output&quot;&gt;&lt;pre&gt;&lt;samp&gt;20
10&lt;/samp&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Notice that the &lt;tt&gt;ppoly&lt;/tt&gt; pointers:&lt;br /&gt;
&lt;br /&gt;
&lt;table class=&quot;snippet&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;1
2&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;CPolygon * ppoly1 = &lt;var&gt;new&lt;/var&gt; CRectangle;
CPolygon * ppoly2 = &lt;var&gt;new&lt;/var&gt; CTriangle;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://homeofcode.blogspot.com/feeds/2977275686064908401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://homeofcode.blogspot.com/2012/03/abstract-base-classes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/2977275686064908401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/2977275686064908401'/><link rel='alternate' type='text/html' href='http://homeofcode.blogspot.com/2012/03/abstract-base-classes.html' title='Abstract base classes'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09283384045723649184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8806767197976217517.post-5790250752944284967</id><published>2012-03-22T22:35:00.001-07:00</published><updated>2012-03-22T22:35:22.691-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OOPS"/><category scheme="http://www.blogger.com/atom/ns#" term="Virtual members"/><title type='text'>Virtual members</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3&gt;
&lt;br /&gt;&lt;/h3&gt;
&lt;i&gt;A member of a class that can be redefined in its derived classes is 
known as a virtual member. In order to declare a member of a class as 
virtual, we must precede its declaration with the keyword &lt;tt&gt;virtual&lt;/tt&gt;:&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;auto&quot;&gt;
&lt;table class=&quot;split&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;&lt;cite&gt;// virtual members&lt;/cite&gt;
&lt;dfn&gt;#include &amp;lt;iostream&amp;gt;&lt;/dfn&gt;
&lt;var&gt;using&lt;/var&gt; &lt;var&gt;namespace&lt;/var&gt; std;

&lt;var&gt;class&lt;/var&gt; CPolygon {
  &lt;var&gt;protected&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; width, height;
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;void&lt;/var&gt; set_values (&lt;var&gt;int&lt;/var&gt; a, &lt;var&gt;int&lt;/var&gt; b)
      { width=a; height=b; }
    &lt;var&gt;virtual&lt;/var&gt; &lt;var&gt;int&lt;/var&gt; area ()
      { &lt;var&gt;return&lt;/var&gt; (0); }
  };

&lt;var&gt;class&lt;/var&gt; CRectangle: &lt;var&gt;public&lt;/var&gt; CPolygon {
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; area ()
      { &lt;var&gt;return&lt;/var&gt; (width * height); }
  };

&lt;var&gt;class&lt;/var&gt; CTriangle: &lt;var&gt;public&lt;/var&gt; CPolygon {
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; area ()
      { &lt;var&gt;return&lt;/var&gt; (width * height / 2); }
  };

&lt;var&gt;int&lt;/var&gt; main () {
  CRectangle rect;
  CTriangle trgl;
  CPolygon poly;
  CPolygon * ppoly1 = &amp;amp;rect;
  CPolygon * ppoly2 = &amp;amp;trgl;
  CPolygon * ppoly3 = &amp;amp;poly;
  ppoly1-&amp;gt;set_values (4,5);
  ppoly2-&amp;gt;set_values (4,5);
  ppoly3-&amp;gt;set_values (4,5);
  cout &amp;lt;&amp;lt; ppoly1-&amp;gt;area() &amp;lt;&amp;lt; endl;
  cout &amp;lt;&amp;lt; ppoly2-&amp;gt;area() &amp;lt;&amp;lt; endl;
  cout &amp;lt;&amp;lt; ppoly3-&amp;gt;area() &amp;lt;&amp;lt; endl;
  &lt;var&gt;return&lt;/var&gt; 0;
}&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;output&quot;&gt;&lt;pre&gt;&lt;samp&gt;20
10
0&lt;/samp&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Now the three classes (&lt;tt&gt;CPolygon&lt;/tt&gt;, &lt;tt&gt;CRectangle&lt;/tt&gt; and &lt;tt&gt;CTriangle&lt;/tt&gt;) have all the same members: &lt;tt&gt;width&lt;/tt&gt;, &lt;tt&gt;height&lt;/tt&gt;, &lt;tt&gt;set_values()&lt;/tt&gt; and &lt;tt&gt;area()&lt;/tt&gt;.&lt;br /&gt;
&lt;br /&gt;
The member function &lt;tt&gt;area()&lt;/tt&gt; has been declared as virtual in the 
base class because it is later redefined in each derived class. You can 
verify if you want that if you remove this &lt;tt&gt;virtual&lt;/tt&gt; keyword from the declaration of &lt;tt&gt;area()&lt;/tt&gt; within &lt;tt&gt;CPolygon&lt;/tt&gt;, and then you run the program the result will be &lt;tt&gt;0&lt;/tt&gt; for the three polygons instead of &lt;tt&gt;20&lt;/tt&gt;, &lt;tt&gt;10&lt;/tt&gt; and &lt;tt&gt;0&lt;/tt&gt;. That is because instead of calling the corresponding &lt;tt&gt;area()&lt;/tt&gt; function for each object (&lt;tt&gt;CRectangle::area()&lt;/tt&gt;, &lt;tt&gt;CTriangle::area()&lt;/tt&gt; and &lt;tt&gt;CPolygon::area()&lt;/tt&gt;, respectively), &lt;tt&gt;CPolygon::area()&lt;/tt&gt; will be called in all cases since the calls are via a pointer whose type is &lt;tt&gt;CPolygon*&lt;/tt&gt;.&lt;br /&gt;
&lt;br /&gt;
Therefore, what the &lt;tt&gt;virtual&lt;/tt&gt; keyword does is to allow a member 
of a derived class with the same name as one in the base class to be 
appropriately called from a pointer, and more precisely when the type of
 the pointer is a pointer to the base class but is pointing to an object
 of the derived class, as in the above example.&lt;br /&gt;
&lt;br /&gt;
A class that declares or inherits a virtual function is called a &lt;i&gt;polymorphic class&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
Note that despite of its virtuality, we have also been able to declare an object of type &lt;tt&gt;CPolygon&lt;/tt&gt; and to call its own &lt;tt&gt;area()&lt;/tt&gt; function, which always returns 0.&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://homeofcode.blogspot.com/feeds/5790250752944284967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://homeofcode.blogspot.com/2012/03/virtual-members.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/5790250752944284967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/5790250752944284967'/><link rel='alternate' type='text/html' href='http://homeofcode.blogspot.com/2012/03/virtual-members.html' title='Virtual members'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09283384045723649184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8806767197976217517.post-1436828030856036294</id><published>2012-03-22T22:31:00.004-07:00</published><updated>2012-03-22T22:31:33.298-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Friend Function"/><category scheme="http://www.blogger.com/atom/ns#" term="OOPS"/><title type='text'>Friend Function</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3&gt;
Friend functions&lt;/h3&gt;
In principle, private and protected members of a class cannot be 
accessed from outside the same class in which they are declared. 
However, this rule does not affect &lt;i&gt;friends&lt;/i&gt;.&lt;br /&gt;

Friends are functions or classes declared with the &lt;code&gt;friend&lt;/code&gt; keyword.&lt;br /&gt;

If we want to declare an external function as friend of a class, thus 
allowing this function to have access to the private and protected 
members of this class, we do it by declaring a prototype of this 
external function within the class, and preceding it with the keyword &lt;tt&gt;friend&lt;/tt&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;auto&quot;&gt;
&lt;table class=&quot;split&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;&lt;cite&gt;// friend functions&lt;/cite&gt;
&lt;dfn&gt;#include &amp;lt;iostream&amp;gt;&lt;/dfn&gt;
&lt;var&gt;using&lt;/var&gt; &lt;var&gt;namespace&lt;/var&gt; std;

&lt;var&gt;class&lt;/var&gt; CRectangle {
    &lt;var&gt;int&lt;/var&gt; width, height;
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;void&lt;/var&gt; set_values (&lt;var&gt;int&lt;/var&gt;, &lt;var&gt;int&lt;/var&gt;);
    &lt;var&gt;int&lt;/var&gt; area () {&lt;var&gt;return&lt;/var&gt; (width * height);}
    &lt;var&gt;friend&lt;/var&gt; CRectangle duplicate (CRectangle);
};

&lt;var&gt;void&lt;/var&gt; CRectangle::set_values (&lt;var&gt;int&lt;/var&gt; a, &lt;var&gt;int&lt;/var&gt; b) {
  width = a;
  height = b;
}

CRectangle duplicate (CRectangle rectparam)
{
  CRectangle rectres;
  rectres.width = rectparam.width*2;
  rectres.height = rectparam.height*2;
  &lt;var&gt;return&lt;/var&gt; (rectres);
}

&lt;var&gt;int&lt;/var&gt; main () {
  CRectangle rect, rectb;
  rect.set_values (2,3);
  rectb = duplicate (rect);
  cout &amp;lt;&amp;lt; rectb.area();
  &lt;var&gt;return&lt;/var&gt; 0;
}&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;output&quot;&gt;&lt;pre&gt;&lt;samp&gt;24 &lt;/samp&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
The &lt;tt&gt;duplicate&lt;/tt&gt; function is a friend of &lt;tt&gt;CRectangle&lt;/tt&gt;. From within that function we have been able to access the members &lt;tt&gt;width&lt;/tt&gt; and &lt;tt&gt;height&lt;/tt&gt; of different objects of type &lt;tt&gt;CRectangle&lt;/tt&gt;, which are private members. Notice that neither in the declaration of &lt;tt&gt;duplicate()&lt;/tt&gt; nor in its later use in &lt;tt&gt;main()&lt;/tt&gt; have we considered &lt;tt&gt;duplicate&lt;/tt&gt; a member of class &lt;tt&gt;CRectangle&lt;/tt&gt;. It isn&#39;t! It simply has access to its private and protected members without being a member.&lt;br /&gt;
&lt;br /&gt;
The friend functions can serve, for example, to conduct operations 
between two different classes. Generally, the use of friend functions is
 out of an object-oriented programming methodology, so whenever possible
 it is better to use members of the same class to perform operations 
with them. Such as in the previous example, it would have been shorter 
to integrate &lt;tt&gt;duplicate()&lt;/tt&gt; within the class &lt;tt&gt;CRectangle&lt;/tt&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;friend_class&quot;&gt;&lt;/a&gt;&lt;h3&gt;
Friend classes&lt;/h3&gt;
Just as we have the possibility to define a friend function, we can also
 define a class as friend of another one, granting that first class 
access to the protected and private members of the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;auto&quot;&gt;
&lt;table class=&quot;split&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;&lt;cite&gt;// friend class&lt;/cite&gt;
&lt;dfn&gt;#include &amp;lt;iostream&amp;gt;&lt;/dfn&gt;
&lt;var&gt;using&lt;/var&gt; &lt;var&gt;namespace&lt;/var&gt; std;

&lt;var&gt;class&lt;/var&gt; CSquare;

&lt;var&gt;class&lt;/var&gt; CRectangle {
    &lt;var&gt;int&lt;/var&gt; width, height;
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; area ()
      {&lt;var&gt;return&lt;/var&gt; (width * height);}
    &lt;var&gt;void&lt;/var&gt; convert (CSquare a);
};

&lt;var&gt;class&lt;/var&gt; CSquare {
  &lt;var&gt;private&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; side;
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;void&lt;/var&gt; set_side (&lt;var&gt;int&lt;/var&gt; a)
      {side=a;}
    &lt;var&gt;friend&lt;/var&gt; &lt;var&gt;class&lt;/var&gt; CRectangle;
};

&lt;var&gt;void&lt;/var&gt; CRectangle::convert (CSquare a) {
  width = a.side;
  height = a.side;
}
  
&lt;var&gt;int&lt;/var&gt; main () {
  CSquare sqr;
  CRectangle rect;
  sqr.set_side(4);
  rect.convert(sqr);
  cout &amp;lt;&amp;lt; rect.area();
  &lt;var&gt;return&lt;/var&gt; 0;
}&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;output&quot;&gt;&lt;pre&gt;&lt;samp&gt;16&lt;/samp&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, we have declared &lt;tt&gt;CRectangle&lt;/tt&gt; as a friend of &lt;tt&gt;CSquare&lt;/tt&gt; so that &lt;tt&gt;CRectangle&lt;/tt&gt; member functions could have access to the protected and private members of &lt;tt&gt;CSquare&lt;/tt&gt;, more concretely to &lt;tt&gt;CSquare::side&lt;/tt&gt;, which describes the side width of the square.&lt;br /&gt;
&lt;br /&gt;
You may also see something new at the beginning of the program: an empty declaration of class &lt;tt&gt;CSquare&lt;/tt&gt;. This is necessary because within the declaration of &lt;tt&gt;CRectangle&lt;/tt&gt; we refer to CSquare (as a parameter in &lt;tt&gt;convert()&lt;/tt&gt;). The definition of &lt;tt&gt;CSquare&lt;/tt&gt; is included later, so if we did not include a previous empty declaration for &lt;tt&gt;CSquare&lt;/tt&gt; this class would not be visible from within the definition of &lt;tt&gt;CRectangle&lt;/tt&gt;.&lt;br /&gt;
&lt;br /&gt;
Consider that friendships are not corresponded if we do not explicitly specify so. In our example, &lt;tt&gt;CRectangle&lt;/tt&gt; is considered as a friend class by &lt;tt&gt;CSquare&lt;/tt&gt;, but &lt;tt&gt;CRectangle&lt;/tt&gt; does not consider &lt;tt&gt;CSquare&lt;/tt&gt; to be a friend, so &lt;tt&gt;CRectangle&lt;/tt&gt; can access the protected and private members of &lt;tt&gt;CSquare&lt;/tt&gt; but not the reverse way. Of course, we could have declared also &lt;tt&gt;CSquare&lt;/tt&gt; as friend of &lt;tt&gt;CRectangle&lt;/tt&gt; if we wanted to.&lt;br /&gt;
&lt;br /&gt;
Another property of friendships is that they are &lt;i&gt;not transitive&lt;/i&gt;: The friend of a friend is not considered to be a friend unless explicitly specified.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://homeofcode.blogspot.com/feeds/1436828030856036294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://homeofcode.blogspot.com/2012/03/friend-function.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/1436828030856036294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/1436828030856036294'/><link rel='alternate' type='text/html' href='http://homeofcode.blogspot.com/2012/03/friend-function.html' title='Friend Function'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09283384045723649184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8806767197976217517.post-3679405896437155103</id><published>2012-03-22T22:26:00.000-07:00</published><updated>2012-03-22T22:26:04.089-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Inheritance"/><category scheme="http://www.blogger.com/atom/ns#" term="Multiple inheritance"/><title type='text'>Multiple inheritance</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3&gt;
&lt;u&gt;Multiple inheritance&lt;/u&gt;&lt;/h3&gt;
&lt;i&gt;In C++ it is perfectly possible that a class inherits members from more 
than one class. This is done by simply separating the different base 
classes with commas in the derived class declaration. For example, if we
 had a specific class to print on screen (&lt;tt&gt;COutput&lt;/tt&gt;) and we wanted our classes &lt;tt&gt;CRectangle&lt;/tt&gt; and &lt;tt&gt;CTriangle&lt;/tt&gt; to also inherit its members in addition to those of &lt;tt&gt;CPolygon&lt;/tt&gt; we could write: &lt;/i&gt;
&lt;br /&gt;
&lt;div class=&quot;auto&quot;&gt;
&lt;table class=&quot;snippet&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;1
2&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;&lt;var&gt;class&lt;/var&gt; CRectangle: &lt;var&gt;public&lt;/var&gt; CPolygon, &lt;var&gt;public&lt;/var&gt; COutput;
&lt;var&gt;class&lt;/var&gt; CTriangle: &lt;var&gt;public&lt;/var&gt; CPolygon, &lt;var&gt;public&lt;/var&gt; COutput;&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
here is the complete example: &lt;br /&gt;
&lt;br /&gt;
&lt;table class=&quot;split&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;&lt;cite&gt;// multiple inheritance&lt;/cite&gt;
&lt;dfn&gt;#include &amp;lt;iostream&amp;gt;&lt;/dfn&gt;
&lt;var&gt;using&lt;/var&gt; &lt;var&gt;namespace&lt;/var&gt; std;

&lt;var&gt;class&lt;/var&gt; CPolygon {
  &lt;var&gt;protected&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; width, height;
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;void&lt;/var&gt; set_values (&lt;var&gt;int&lt;/var&gt; a, &lt;var&gt;int&lt;/var&gt; b)
      { width=a; height=b;}
  };

&lt;var&gt;class&lt;/var&gt; COutput {
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;void&lt;/var&gt; output (&lt;var&gt;int&lt;/var&gt; i);
  };

&lt;var&gt;void&lt;/var&gt; COutput::output (&lt;var&gt;int&lt;/var&gt; i) {
  cout &amp;lt;&amp;lt; i &amp;lt;&amp;lt; endl;
  }

&lt;var&gt;class&lt;/var&gt; CRectangle: &lt;var&gt;public&lt;/var&gt; CPolygon, &lt;var&gt;public&lt;/var&gt; COutput {
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; area ()
      { &lt;var&gt;return&lt;/var&gt; (width * height); }
  };

&lt;var&gt;class&lt;/var&gt; CTriangle: &lt;var&gt;public&lt;/var&gt; CPolygon, &lt;var&gt;public&lt;/var&gt; COutput {
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; area ()
      { &lt;var&gt;return&lt;/var&gt; (width * height / 2); }
  };
  
&lt;var&gt;int&lt;/var&gt; main () {
  CRectangle rect;
  CTriangle trgl;
  rect.set_values (4,5);
  trgl.set_values (4,5);
  rect.output (rect.area());
  trgl.output (trgl.area());
  &lt;var&gt;return&lt;/var&gt; 0;
}&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://homeofcode.blogspot.com/feeds/3679405896437155103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://homeofcode.blogspot.com/2012/03/multiple-inheritance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/3679405896437155103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/3679405896437155103'/><link rel='alternate' type='text/html' href='http://homeofcode.blogspot.com/2012/03/multiple-inheritance.html' title='Multiple inheritance'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09283384045723649184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8806767197976217517.post-8969072825889263163</id><published>2012-03-22T22:24:00.002-07:00</published><updated>2012-03-22T22:24:46.027-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Inheritance"/><title type='text'>Inheritance</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3&gt;
&lt;u&gt;Inheritance between classes&lt;/u&gt;&lt;/h3&gt;
&lt;i&gt;A key feature of C++ classes is inheritance. Inheritance allows to 
create classes which are derived from other classes, so that they 
automatically include some of its &quot;parent&#39;s&quot; members, plus its own. For 
example, we are going to suppose that we want to declare a series of 
classes that describe polygons like our &lt;tt&gt;CRectangle&lt;/tt&gt;, or like &lt;tt&gt;CTriangle&lt;/tt&gt;. They have certain common properties, such as both can be described by means of only two sides: height and base.&lt;/i&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This could be represented in the world of classes with a class &lt;tt&gt;CPolygon&lt;/tt&gt; from which we would derive the two other ones: &lt;tt&gt;CRectangle&lt;/tt&gt; and &lt;tt&gt;CTriangle&lt;/tt&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;&quot; src=&quot;http://www.cplusplus.com/doc/tutorial/inheritance/inheritance.gif&quot; /&gt;
&lt;br /&gt;
The class &lt;tt&gt;CPolygon&lt;/tt&gt; would contain members that are common for both types of polygon. In our case: &lt;tt&gt;width&lt;/tt&gt; and &lt;tt&gt;height&lt;/tt&gt;. And &lt;tt&gt;CRectangle&lt;/tt&gt; and &lt;tt&gt;CTriangle&lt;/tt&gt; would be its derived classes, with specific features that are different from one type of polygon to the other.&lt;br /&gt;
&lt;br /&gt;
Classes that are derived from others inherit all the accessible members 
of the base class. That means that if a base class includes a member &lt;tt&gt;A&lt;/tt&gt; and we derive it to another class with another member called &lt;tt&gt;B&lt;/tt&gt;, the derived class will contain both members &lt;tt&gt;A&lt;/tt&gt; and &lt;tt&gt;B&lt;/tt&gt;.&lt;br /&gt;
&lt;br /&gt;
In order to derive a class from another, we use a colon (&lt;tt&gt;:&lt;/tt&gt;) in the declaration of the derived class using the following format: &lt;br /&gt;
&lt;br /&gt;
&lt;tt&gt;
class derived_class_name: public base_class_name&lt;br /&gt;
{ /*...*/ };&lt;br /&gt;
&lt;/tt&gt;
&lt;br /&gt;
Where &lt;tt&gt;derived_class_name&lt;/tt&gt; is the name of the derived class and &lt;tt&gt;base_class_name&lt;/tt&gt; is the name of the class on which it is based. The &lt;tt&gt;public&lt;/tt&gt; access specifier may be replaced by any one of the other access specifiers &lt;tt&gt;protected&lt;/tt&gt; and &lt;tt&gt;private&lt;/tt&gt;.
 This access specifier limits the most accessible level for the members 
inherited from the base class: The members with a more accessible level 
are inherited with this level instead, while the members with an equal 
or more restrictive access level keep their restrictive level in the 
derived class.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;auto&quot;&gt;
&lt;table class=&quot;split&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;&lt;cite&gt;// derived classes&lt;/cite&gt;
&lt;dfn&gt;#include &amp;lt;iostream&amp;gt;&lt;/dfn&gt;
&lt;var&gt;using&lt;/var&gt; &lt;var&gt;namespace&lt;/var&gt; std;

&lt;var&gt;class&lt;/var&gt; CPolygon {
  &lt;var&gt;protected&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; width, height;
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;void&lt;/var&gt; set_values (&lt;var&gt;int&lt;/var&gt; a, &lt;var&gt;int&lt;/var&gt; b)
      { width=a; height=b;}
  };

&lt;var&gt;class&lt;/var&gt; CRectangle: &lt;var&gt;public&lt;/var&gt; CPolygon {
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; area ()
      { &lt;var&gt;return&lt;/var&gt; (width * height); }
  };

&lt;var&gt;class&lt;/var&gt; CTriangle: &lt;var&gt;public&lt;/var&gt; CPolygon {
  &lt;var&gt;public&lt;/var&gt;:
    &lt;var&gt;int&lt;/var&gt; area ()
      { &lt;var&gt;return&lt;/var&gt; (width * height / 2); }
  };
  
&lt;var&gt;int&lt;/var&gt; main () {
  CRectangle rect;
  CTriangle trgl;
  rect.set_values (4,5);
  trgl.set_values (4,5);
  cout &amp;lt;&amp;lt; rect.area() &amp;lt;&amp;lt; endl;
  cout &amp;lt;&amp;lt; trgl.area() &amp;lt;&amp;lt; endl;
  &lt;var&gt;return&lt;/var&gt; 0;
}&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;output&quot;&gt;&lt;pre&gt;&lt;samp&gt;20
10&lt;/samp&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
The objects of the classes &lt;tt&gt;CRectangle&lt;/tt&gt; and &lt;tt&gt;CTriangle&lt;/tt&gt; each contain members inherited from &lt;tt&gt;CPolygon&lt;/tt&gt;. These are: &lt;tt&gt;width&lt;/tt&gt;, &lt;tt&gt;height&lt;/tt&gt; and &lt;tt&gt;set_values()&lt;/tt&gt;.&lt;br /&gt;
&lt;br /&gt;
The &lt;tt&gt;protected&lt;/tt&gt; access specifier is similar to &lt;tt&gt;private&lt;/tt&gt;. 
Its only difference occurs in fact with inheritance. When a class 
inherits from another one, the members of the derived class can access 
the protected members inherited from the base class, but not its private
 members.&lt;br /&gt;
&lt;br /&gt;
Since we wanted &lt;tt&gt;width&lt;/tt&gt; and &lt;tt&gt;height&lt;/tt&gt; to be accessible from members of the derived classes &lt;tt&gt;CRectangle&lt;/tt&gt; and &lt;tt&gt;CTriangle&lt;/tt&gt; and not only by members of &lt;tt&gt;CPolygon&lt;/tt&gt;, we have used &lt;tt&gt;protected&lt;/tt&gt; access instead of &lt;tt&gt;private&lt;/tt&gt;.&lt;br /&gt;
&lt;br /&gt;
We can summarize the different access types according to who can access them in the following way: &lt;br /&gt;
&lt;br /&gt;
&lt;table class=&quot;boxed&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Access&lt;/th&gt;&lt;th&gt;public&lt;/th&gt;&lt;th&gt;protected&lt;/th&gt;&lt;th&gt;private&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;members of the same class&lt;/td&gt;&lt;td&gt;yes&lt;/td&gt;&lt;td&gt;yes&lt;/td&gt;&lt;td&gt;yes&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;members of derived classes&lt;/td&gt;&lt;td&gt;yes&lt;/td&gt;&lt;td&gt;yes&lt;/td&gt;&lt;td&gt;no&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;not members&lt;/td&gt;&lt;td&gt;yes&lt;/td&gt;&lt;td&gt;no&lt;/td&gt;&lt;td&gt;no&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Where &quot;not members&quot; represent any access from outside the class, such as from &lt;tt&gt;main()&lt;/tt&gt;, from another class or from a function.&lt;br /&gt;
&lt;br /&gt;
In our example, the members inherited by &lt;tt&gt;CRectangle&lt;/tt&gt; and &lt;tt&gt;CTriangle&lt;/tt&gt; have the same access permissions as they had in their base class &lt;tt&gt;CPolygon&lt;/tt&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;auto&quot;&gt;
&lt;table class=&quot;snippet&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;1
2
3
4
5&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;CPolygon::width           &lt;cite&gt;// protected access&lt;/cite&gt;
CRectangle::width         &lt;cite&gt;// protected access&lt;/cite&gt;

CPolygon::set_values()    &lt;cite&gt;// public access&lt;/cite&gt;
CRectangle::set_values()  &lt;cite&gt;// public access &lt;/cite&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
This is because we have used the &lt;tt&gt;public&lt;/tt&gt; keyword to define the inheritance relationship on each of the derived classes:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;auto&quot;&gt;
&lt;table class=&quot;snippet&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;&lt;var&gt;class&lt;/var&gt; CRectangle: &lt;var&gt;public&lt;/var&gt; CPolygon { ... }&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
This &lt;tt&gt;public&lt;/tt&gt; keyword after the colon (&lt;tt&gt;:&lt;/tt&gt;) denotes the most accessible level the members inherited from the class that follows it (in this case &lt;tt&gt;CPolygon&lt;/tt&gt;) will have. Since &lt;tt&gt;public&lt;/tt&gt;
 is the most accessible level, by specifying this keyword the derived 
class will inherit all the members with the same levels they had in the 
base class.&lt;br /&gt;
&lt;br /&gt;
If we specify a more restrictive access level like &lt;tt&gt;protected&lt;/tt&gt;, 
all public members of the base class are inherited as protected in the 
derived class. Whereas if we specify the most restricting of all access 
levels: &lt;tt&gt;private&lt;/tt&gt;, all the base class members are inherited as private.&lt;br /&gt;
&lt;br /&gt;
For example, if &lt;tt&gt;daughter&lt;/tt&gt; was a class derived from &lt;tt&gt;mother&lt;/tt&gt; that we defined as:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;auto&quot;&gt;
&lt;table class=&quot;snippet&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;&lt;var&gt;class&lt;/var&gt; daughter: &lt;var&gt;protected&lt;/var&gt; mother;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
This would set &lt;tt&gt;protected&lt;/tt&gt; as the maximum access level for the members of &lt;tt&gt;daughter&lt;/tt&gt; that it inherited from &lt;tt&gt;mother&lt;/tt&gt;. That is, all members that were public in &lt;tt&gt;mother&lt;/tt&gt; would become protected in &lt;tt&gt;daughter&lt;/tt&gt;. Of course, this would not restrict &lt;tt&gt;daughter&lt;/tt&gt; to declare its own public members. That maximum access level is only set for the members inherited from &lt;tt&gt;mother&lt;/tt&gt;.&lt;br /&gt;
&lt;br /&gt;
If we do not explicitly specify any access level for the inheritance, the compiler assumes private for classes declared with &lt;tt&gt;class&lt;/tt&gt; keyword and public for those declared with &lt;tt&gt;struct&lt;/tt&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
What is inherited from the base class?&lt;/h3&gt;
In principle, a derived class inherits every member of a base class except:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;its constructor and its destructor &lt;/li&gt;
&lt;li&gt;its operator=() members&lt;/li&gt;
&lt;li&gt;its friends&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Although the constructors and destructors of the base class are not 
inherited themselves, its default constructor (i.e., its constructor 
with no parameters) and its destructor are always called when a new 
object of a derived class is created or destroyed.&lt;br /&gt;
&lt;br /&gt;
If the base class has no default constructor or you want that an 
overloaded constructor is called when a new derived object is created, 
you can specify it in each constructor definition of the derived class:&lt;br /&gt;
&lt;br /&gt;
&lt;tt&gt;
derived_constructor_name (parameters) : base_constructor_name (parameters) {...}&lt;br /&gt;
&lt;/tt&gt;
&lt;br /&gt;
For example: &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;auto&quot;&gt;
&lt;table class=&quot;split&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;&lt;cite&gt;// constructors and derived classes&lt;/cite&gt;
&lt;dfn&gt;#include &amp;lt;iostream&amp;gt;&lt;/dfn&gt;
&lt;var&gt;using&lt;/var&gt; &lt;var&gt;namespace&lt;/var&gt; std;

&lt;var&gt;class&lt;/var&gt; mother {
  &lt;var&gt;public&lt;/var&gt;:
    mother ()
      { cout &amp;lt;&amp;lt; &lt;kbd&gt;&quot;mother: no parameters\n&quot;&lt;/kbd&gt;; }
    mother (&lt;var&gt;int&lt;/var&gt; a)
      { cout &amp;lt;&amp;lt; &lt;kbd&gt;&quot;mother: int parameter\n&quot;&lt;/kbd&gt;; }
};

&lt;var&gt;class&lt;/var&gt; daughter : &lt;var&gt;public&lt;/var&gt; mother {
  &lt;var&gt;public&lt;/var&gt;:
    daughter (&lt;var&gt;int&lt;/var&gt; a)
      { cout &amp;lt;&amp;lt; &lt;kbd&gt;&quot;daughter: int parameter\n\n&quot;&lt;/kbd&gt;; }
};

&lt;var&gt;class&lt;/var&gt; son : &lt;var&gt;public&lt;/var&gt; mother {
  &lt;var&gt;public&lt;/var&gt;:
    son (&lt;var&gt;int&lt;/var&gt; a) : mother (a)
      { cout &amp;lt;&amp;lt; &lt;kbd&gt;&quot;son: int parameter\n\n&quot;&lt;/kbd&gt;; }
};

&lt;var&gt;int&lt;/var&gt; main () {
  daughter cynthia (0);
  son daniel(0);
  
  &lt;var&gt;return&lt;/var&gt; 0;
}&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;output&quot;&gt;&lt;pre&gt;&lt;samp&gt;mother: no parameters
daughter: int parameter
 
mother: int parameter
son: int parameter&lt;/samp&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Notice the difference between which &lt;tt&gt;mother&lt;/tt&gt;&#39;s constructor is called when a new &lt;tt&gt;daughter&lt;/tt&gt; object is created and which when it is a &lt;tt&gt;son&lt;/tt&gt; object. The difference is because the constructor declaration of &lt;tt&gt;daughter&lt;/tt&gt; and &lt;tt&gt;son&lt;/tt&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;auto&quot;&gt;
&lt;table class=&quot;snippet&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;pre&gt;&lt;code&gt;1
2&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;source&quot;&gt;&lt;pre&gt;&lt;code&gt;daughter (&lt;var&gt;int&lt;/var&gt; a)          &lt;cite&gt;// nothing specified: call default&lt;/cite&gt;
son (&lt;var&gt;int&lt;/var&gt; a) : mother (a)  &lt;cite&gt;// constructor specified: call this &lt;/cite&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;table class=&quot;split&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;rownum&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;source&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://homeofcode.blogspot.com/feeds/8969072825889263163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://homeofcode.blogspot.com/2012/03/inheritance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/8969072825889263163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8806767197976217517/posts/default/8969072825889263163'/><link rel='alternate' type='text/html' href='http://homeofcode.blogspot.com/2012/03/inheritance.html' title='Inheritance'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09283384045723649184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>