<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>ITech Society</title>
	
	<link>http://www.itechsociety.com</link>
	<description>Information Technology: Programming Tutorials and More</description>
	<lastBuildDate>Fri, 09 Sep 2011 06:23:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ITechSociety" /><feedburner:info uri="itechsociety" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>ITechSociety</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>The Range of Visual Studio 2010 Express Products</title>
		<link>http://feedproxy.google.com/~r/ITechSociety/~3/N8kmc6O77co/</link>
		<comments>http://www.itechsociety.com/2011/09/the-range-of-visual-studio-2010-express-products/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 06:23:23 +0000</pubDate>
		<dc:creator>chicoi08</dc:creator>
				<category><![CDATA[Gadget and software reviews]]></category>

		<guid isPermaLink="false">http://www.itechsociety.com/?p=1039</guid>
		<description><![CDATA[There are a few products in the Microsoft Visual Studio 2010 Express range. This includes a Visual Studio Express for Windows Phone. With this, you will be able to get started on developing applications for phones. Then we have the &#8230; <a href="http://www.itechsociety.com/2011/09/the-range-of-visual-studio-2010-express-products/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/TyIVh3U5tyRFcZ-BrSVKNXXE2q8/0/da"><img src="http://feedads.g.doubleclick.net/~a/TyIVh3U5tyRFcZ-BrSVKNXXE2q8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/TyIVh3U5tyRFcZ-BrSVKNXXE2q8/1/da"><img src="http://feedads.g.doubleclick.net/~a/TyIVh3U5tyRFcZ-BrSVKNXXE2q8/1/di" border="0" ismap="true"></img></a></p><p>There are a few products in the Microsoft Visual Studio 2010 Express range. This includes a Visual Studio Express for Windows Phone. With this, you will be able to get started on developing applications for phones.<br />
<span id="more-1039"></span><br />
Then we have the Visual Web Developer 2010 Express. This allows you to build and run websites using the Microsoft Web Platform. It provides everything that you will need, leaving you with more free time to really develop your ideas, or even chill out for a bit and play <a href="http://si.partypoker.com/">partypoker</a> . The framework, database, web server and tools are all included and you should find it very convenient and easy to use once you have grasped the basics.</p>
<p>The Windows Basic 2010 Express is a great option for all abilities. There are both basic and expert settings, so everyone is catered for. Custom .NET Framework-based Windows applications can be created and all programs will have good security and language interoperability.</p>
<p>Next we have the Visual C# 2010 Express. This is type-safe, simple and object-oriented, as well as powerful and fast. Applications can be developed rapidly, while retaining the elegance and expressiveness of C-style languages.</p>
<p>If you want to have strict control when building Windows (COM+) or .NET Framework managed Windows applications, then Visual C++ 2010 Express is the one for you. It has a powerful language that allows you to do this and you are sure to be impressed with the results.</p>
<p>Last but by no means least is the Visual Studio 2010 Express all-in-one ISO. With this edition, you get an ISO image file that allows you to install the products in the Visual Studio Express range without needing internet access. This does not include Visual Studio 2010 Express for Windows Phone, but does include Visual Basic 2010 Express, Visual C++ 2010 Express, Visual C# Express and Visual Web Developer 2010 Express.<!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itechsociety.com/2011/09/the-range-of-visual-studio-2010-express-products/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.itechsociety.com/2011/09/the-range-of-visual-studio-2010-express-products/</feedburner:origLink></item>
		<item>
		<title>Host Gator Discount Coupons – 2011</title>
		<link>http://feedproxy.google.com/~r/ITechSociety/~3/h1zB2ToDaT4/</link>
		<comments>http://www.itechsociety.com/2011/03/host-gator-discount-coupons/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 05:27:00 +0000</pubDate>
		<dc:creator>chicoi08</dc:creator>
				<category><![CDATA[Domain name and Hosting]]></category>

		<guid isPermaLink="false">http://www.itechsociety.com/?p=1028</guid>
		<description><![CDATA[Below is listed some usefull Host Gator Coupons. You can use the following hosting discount codes to get save some money. To save $9.94 on your hosting charges enter any of the coupon codes below GOHOSTGATOR994 hgc25 For 25% discount &#8230; <a href="http://www.itechsociety.com/2011/03/host-gator-discount-coupons/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/ewheTUh5nZhjVkfB3JMiuw9i8tY/0/da"><img src="http://feedads.g.doubleclick.net/~a/ewheTUh5nZhjVkfB3JMiuw9i8tY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ewheTUh5nZhjVkfB3JMiuw9i8tY/1/da"><img src="http://feedads.g.doubleclick.net/~a/ewheTUh5nZhjVkfB3JMiuw9i8tY/1/di" border="0" ismap="true"></img></a></p><p><span id="more-1028"></span>Below is listed some usefull <strong>Host Gator Coupons</strong>. You can use the following<strong> hosting discount codes</strong> to get save some money.</p>
<p>To save $9.94 on your hosting charges enter any of the coupon codes below</p>
<p><a href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=chicoi08" target="_blank">GOHOSTGATOR994</a><br />
<a href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=chicoi08" target="_blank"> hgc25</a></p>
<p>For 25% discount you can use</p>
<p><a href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=chicoi08" target="_blank">GOHOSTGATOR25</a></p>
<p><a href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=chicoi08-"><img src="http://tracking.hostgator.com/img/Shared_Blue/468x60-animated.gif" border="0" alt="" /></a></p>
<p>Make sure you use the coupon codes to get discounts.<!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itechsociety.com/2011/03/host-gator-discount-coupons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.itechsociety.com/2011/03/host-gator-discount-coupons/</feedburner:origLink></item>
		<item>
		<title>Visual Basic .NET – Simple Web Browser</title>
		<link>http://feedproxy.google.com/~r/ITechSociety/~3/SgVmItnmSh4/</link>
		<comments>http://www.itechsociety.com/2010/11/visual-basic-net-simple-web-browser/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 02:10:23 +0000</pubDate>
		<dc:creator>chicoi08</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Screencast]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Visual Basic]]></category>

		<guid isPermaLink="false">http://www.itechsociety.com/?p=969</guid>
		<description><![CDATA[Before you start making your very own web browser using visual basic you need a compiler. Please read this if you don&#8217;t have the VB .NET Express Edition. http://www.itechsociety.com/2010/09/microsoft-visual-studio-express-edition/ Starting Up First start up your Integrated Development Environment(IDE). In this &#8230; <a href="http://www.itechsociety.com/2010/11/visual-basic-net-simple-web-browser/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/0EbtqaZd50e6eXCtPtRSh0yXsb8/0/da"><img src="http://feedads.g.doubleclick.net/~a/0EbtqaZd50e6eXCtPtRSh0yXsb8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/0EbtqaZd50e6eXCtPtRSh0yXsb8/1/da"><img src="http://feedads.g.doubleclick.net/~a/0EbtqaZd50e6eXCtPtRSh0yXsb8/1/di" border="0" ismap="true"></img></a></p><p><span id="more-969"></span>Before you start making your very own web browser using visual basic you need a compiler. Please read this if you don&#8217;t have the VB .NET Express Edition. <a href="../2010/09/microsoft-visual-studio-express-edition/">http://www.itechsociety.com/2010/09/microsoft-visual-studio-express-edition/</a></p>
<h4>Starting Up</h4>
<div id="attachment_992" class="wp-caption aligncenter" style="width: 561px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/Vb2010.png" rel="lightbox[969]" title="Vb2010"><img class="size-full wp-image-992" title="Vb2010" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/Vb2010.png" alt="MS VB 2010 EE" width="551" height="387" /></a><p class="wp-caption-text">MS VB 2010 Express Eddition</p></div>
<p>First start up your Integrated Development Environment(IDE). In this tutorial I will be using MS Visual Basic 2010 Express Edition. Create a new Project by clicking File &gt; New Project or ctrl + N for windows.</p>
<p>You will then be prompted with a new form. We will transform this simple form and make a web browser change its property according to the following:</p>
<ul>
<li>Text &#8211; My Web Browser</li>
</ul>
<div id="attachment_987" class="wp-caption aligncenter" style="width: 236px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/formname.png" rel="lightbox[969]" title="formname"><img class="size-full wp-image-987" title="formname" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/formname.png" alt="Form Name" width="226" height="166" /></a><p class="wp-caption-text">Form Name</p></div>
<p>If you can&#8217;t see your toolbox then in the Menu bar just click View &gt; Other Windows &gt; Toolbox or hit ctrl+alt+x for windows.</p>
<div id="attachment_993" class="wp-caption aligncenter" style="width: 463px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/webbrowserobject.png" rel="lightbox[969]" title="webbrowserobject"><img class="size-full wp-image-993" title="webbrowserobject" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/webbrowserobject.png" alt="Web Browser Tool" width="453" height="196" /></a><p class="wp-caption-text">Web Browser Tool</p></div>
<p>Go on to the toolbox and double click the WebBrowser tool. You will see that the WebBrowsertool will occupy the whole form.For us to resize the WebBrowser, we have to undock it from the parent container. Select the WebBrowser and then clicking the right arrow head on the top right part of the form will show you &#8220;undock in parent container&#8221; option. Click that.</p>
<div id="attachment_990" class="wp-caption aligncenter" style="width: 463px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/undock.png" rel="lightbox[969]" title="undock"><img class="size-full wp-image-990" title="undock" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/undock.png" alt="Undock" width="453" height="196" /></a><p class="wp-caption-text">Undock the Web Browser</p></div>
<p>Now click again the WebBrowser and then try to resize it according your heart&#8217;s desire using your mouse. Now change the URL property to a website that you want to visit. In this vb example I used google.com.</p>
<ul>
<li>Url &#8211; google.com</li>
</ul>
<div id="attachment_991" class="wp-caption aligncenter" style="width: 277px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/Url.png" rel="lightbox[969]" title="Url"><img class="size-full wp-image-991" title="Url" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/Url.png" alt="Set the Url Property" width="267" height="166" /></a><p class="wp-caption-text">Set the Url Property</p></div>
<p>We can now try this one first. But before we do that make sure that you are connected to the internet. You must now be able to visit google.com.</p>
<div id="attachment_988" class="wp-caption aligncenter" style="width: 747px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/google.png" rel="lightbox[969]" title="google"><img class="size-full wp-image-988" title="google" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/google.png" alt="Web Browser Home page" width="737" /></a><p class="wp-caption-text">Web Browser Home page</p></div>
<h4>The Codes</h4>
<p>Let&#8217;s add a new button. We will try to navigate away from google using this button. Change it&#8217;s properties according to the following:</p>
<ul>
<li>Text &#8211; Go</li>
<li>Name &#8211; GoBtn</li>
</ul>
<p>Double click the button to create a trigger. You will see that a private sub will be created for you. In between the private sub and end sub type in this code.</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">        WebBrowser1.<span style="color: #0000FF;">Navigate</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;facebook.com&quot;</span><span style="color: #000000;">&#41;</span></pre></div></div>

<p>You should now have something like this.</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">    <span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Sub</span> Button1_Click<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> sender <span style="color: #FF8000;">As</span> System.<span style="color: #FF0000;">Object</span>, <span style="color: #FF8000;">ByVal</span> e <span style="color: #FF8000;">As</span> System.<span style="color: #0000FF;">EventArgs</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">Handles</span> Button1.<span style="color: #0000FF;">Click</span>
        WebBrowser1.<span style="color: #0000FF;">Navigate</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;facebook.com&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span></pre></div></div>

<p>You can replace this line to anything website address that you want.</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #808080;">&quot;facebook.com&quot;</span></pre></div></div>

<p>So if that&#8217;s perfectly navigating you away from google and bringing you to the website that you have specified, we are now ready to move one. Of course we don&#8217;t want to make a web browser that is difficult to use. We need a way to make things easier for our user to change into different websites. The solution there is the address box. The address box will serve as user input for the web address that they want to access.</p>
<h4>The Address Bar</h4>
<p>So to add a textbox click the textbox tool from the toolbox. Drag and drop it to our form then change the following attributes.</p>
<ul>
<li>Name &#8211; addressTxt</li>
</ul>
<div id="attachment_989" class="wp-caption aligncenter" style="width: 400px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/textbox.png" rel="lightbox[969]" title="textbox"><img class="size-full wp-image-989" title="textbox" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/textbox.png" alt="textbox Property" width="390" height="184" /></a><p class="wp-caption-text">Change the Textbox Property</p></div>
<p>Then go back to our button and change this line</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">WebBrowser1.<span style="color: #0000FF;">Navigate</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;facebook.com&quot;</span><span style="color: #000000;">&#41;</span></pre></div></div>

<p>to this</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">WebBrowser1.<span style="color: #0000FF;">Navigate</span><span style="color: #000000;">&#40;</span>addressTxt.<span style="color: #0000FF;">Text</span><span style="color: #000000;">&#41;</span></pre></div></div>

<p>This simply means that we want to navigate to what ever is the text value of addressTxt.</p>
<p>Now try the web browser. Go to different websites like facebook, youtube, and google.</p>
<h4>Extra Buttons</h4>
<div id="attachment_1001" class="wp-caption aligncenter" style="width: 268px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/4buttons.png" rel="lightbox[969]" title="4buttons"><img class="size-full wp-image-1001" title="4buttons" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/4buttons.png" alt="Web Browser Navigation Buttons" width="258" height="154" /></a><p class="wp-caption-text">Web Browser Navigation Buttons</p></div>
<p>Of course we also need a way for our users to navigate back and forward from web pages. We should also add other basic buttons like refresh and stop. So let&#8217;s try to do this.</p>
<p>First add 4 different buttons with the following attributes.</p>
<table>
<tbody>
<tr>
<td>Button 1</td>
<td>Name: BackBtn<br />
Text: Back<br />
Size: 40, 40</td>
</tr>
<tr>
<td>Button 2</td>
<td>Name: RefreshBtn<br />
Text: Refresh<br />
Size: 40, 40</td>
</tr>
<tr>
<td>Button 3</td>
<td>Name: StopBtn<br />
Text: Stop<br />
Size: 40, 40</td>
</tr>
<tr>
<td>Button 4</td>
<td>Name: ForwardBtn<br />
Text: Forward<br />
Size: 40, 40</td>
</tr>
</tbody>
</table>
<p>Next. Double click the buttons to create a new trigger and add these codes.</p>
<ol>
<li>For BackBtn

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">        WebBrowser1.<span style="color: #0000FF;">GoBack</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></pre></div></div>

</li>
<li>For RefreshBtn

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">        WebBrowser1.<span style="color: #0000FF;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></pre></div></div>

</li>
<li>For StopBtn

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">        WebBrowser1.<span style="color: #0600FF;">Stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></pre></div></div>

</li>
<li>For ForwardBtn

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">        WebBrowser1.<span style="color: #0000FF;">GoForward</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></pre></div></div>

</li>
</ol>
<p>That should work perfectly now.</p>
<h4>Final Touches</h4>
<p>We can now fix the overall appearance of our application. You can try to add an image for the buttons. You can found lots of cool icons here at <a title="IconArchive" href="http://adf.ly/BNRZ" target="_blank">IconArchive</a>.</p>
<p>To make our program follow the size of the window, apply the following anchor attributes:</p>
<div id="attachment_1002" class="wp-caption aligncenter" style="width: 268px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/anchor.png" rel="lightbox[969]" title="anchor"><img class="size-full wp-image-1002" title="anchor" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/anchor.png" alt="Anchor" width="258" height="154" /></a><p class="wp-caption-text">Anchor Attribute</p></div>
<table>
<tbody>
<tr>
<td>Web Browser</td>
<td>Anchor : Top, Bottom, Left, Right</td>
</tr>
<tr>
<td>Navigation Buttons</td>
<td>Anchor : Top, Left</td>
</tr>
<tr>
<td>Address Textbox</td>
<td>Anchor: Top, Left, Right</td>
</tr>
<tr>
<td>Go Button</td>
<td>Top, Right</td>
</tr>
</tbody>
</table>
<p><!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itechsociety.com/2010/11/visual-basic-net-simple-web-browser/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.itechsociety.com/2010/11/visual-basic-net-simple-web-browser/</feedburner:origLink></item>
		<item>
		<title>C Programming Tutorial 6 – Assignment Operator</title>
		<link>http://feedproxy.google.com/~r/ITechSociety/~3/gADJRAWmIjg/</link>
		<comments>http://www.itechsociety.com/2010/11/c-programming-tutorial-6-assignment-operator/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 11:28:12 +0000</pubDate>
		<dc:creator>chicoi08</dc:creator>
				<category><![CDATA[C/C#/C++]]></category>
		<category><![CDATA[Lessons]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[operator assignment]]></category>

		<guid isPermaLink="false">http://www.itechsociety.com/?p=928</guid>
		<description><![CDATA[We have already seen this in the previous lesson, C Programming Tutorial 2 &#8211; Intro To Variables. But what does it actually do? Simple ( = ) The Assignment operator is represented by an equal sign. ( = ) Take &#8230; <a href="http://www.itechsociety.com/2010/11/c-programming-tutorial-6-assignment-operator/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/oqGx4MFz78L8730hsFbquHDiajk/0/da"><img src="http://feedads.g.doubleclick.net/~a/oqGx4MFz78L8730hsFbquHDiajk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/oqGx4MFz78L8730hsFbquHDiajk/1/da"><img src="http://feedads.g.doubleclick.net/~a/oqGx4MFz78L8730hsFbquHDiajk/1/di" border="0" ismap="true"></img></a></p><p><span id="more-928"></span>We have already seen this in the previous lesson, <a href="http://www.itechsociety.com/tutorials/programming/ccc/lessons/c-tutorial-2-intro-to-variables/">C Programming Tutorial 2 &#8211; Intro To Variables</a>. But what does it actually do?</p>
<h4>Simple ( = )</h4>
<p>The <strong>Assignment operator</strong> is represented by an <strong>equal sign. ( = )</strong><br />
Take a look at the following example.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">sum <span style="color: #339933;">=</span> <span style="color: #0000dd;">200</span><span style="color: #339933;">;</span></pre></div></div>

<p>The <strong>sum</strong> is our variable and <strong>200</strong> is the value. If you had any algebra subjects before, this is surely not new to you. We have assigned the value 200 to the variable sum using and equal sign. In C language it is always from right-to-left and never the other way. Meaning the variable that you want to use to store the value must always be on the left side and the value you want to store on the right side. Take a look at the following example.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">a <span style="color: #339933;">=</span> b</pre></div></div>

<p>This means that what ever is the value of the variable <strong>b</strong>, we are assigning that value to variable <strong>a</strong> too. Then if <strong>b</strong> is equal to 10, then <strong>a </strong>is also equal to 10.<br />
<strong>Sample code</strong></p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include&lt;stdio.h&gt;</span>
main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
     <span style="color: #993333;">int</span> a<span style="color: #339933;">,</span> b<span style="color: #339933;">;</span>
&nbsp;
     b <span style="color: #339933;">=</span> <span style="color: #0000dd;">10</span><span style="color: #339933;">;</span>
     a <span style="color: #339933;">=</span> b<span style="color: #339933;">;</span>
&nbsp;
     <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%d&quot;</span><span style="color: #339933;">,</span> a<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     getch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The output will be</p>
<pre>10</pre>
<p>Take a look at another example.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include&lt;stdio.h&gt;</span>
main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
     <span style="color: #993333;">int</span> a<span style="color: #339933;">,</span> b<span style="color: #339933;">;</span>
&nbsp;
     a <span style="color: #339933;">=</span> <span style="color: #0000dd;">10</span><span style="color: #339933;">;</span>
     b <span style="color: #339933;">=</span> <span style="color: #0000dd;">2</span><span style="color: #339933;">;</span>
     a <span style="color: #339933;">=</span> <span style="color: #0000dd;">4</span><span style="color: #339933;">;</span>
&nbsp;
     <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%dn&quot;</span><span style="color: #339933;">,</span> a<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%d &quot;</span><span style="color: #339933;">,</span> b<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     getch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The output will be</p>
<pre>4
2</pre>
<p>As you see the output is 4 and 2. Why? Because even if we have already assigned a value of 10 to the variable <strong>a</strong>, it was changed to 4 after we assigned a new value to it. This is because of the top-to-bottom and right-to-left rule.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include&lt;stdio.h&gt;</span>
main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
     <span style="color: #993333;">int</span> a<span style="color: #339933;">,</span> b<span style="color: #339933;">;</span>
&nbsp;
     a <span style="color: #339933;">=</span> b <span style="color: #339933;">=</span> <span style="color: #0000dd;">2</span><span style="color: #339933;">;</span>
&nbsp;
     <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%dn&quot;</span><span style="color: #339933;">,</span> a<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%d &quot;</span><span style="color: #339933;">,</span> b<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     getch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The output will be</p>
<pre>2
2</pre>
<p>This assigns <strong>a</strong> and <strong>b</strong> a value of 2.</p>
<p>Here are some other ways to assign a value to c variables.</p>
<h4>Compound Assignments in C</h4>
<p>Assume</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> a <span style="color: #339933;">=</span> <span style="color: #0000dd;">3</span></pre></div></div>

<table>
<tr>
<td>Operator</td>
<td>Usage</td>
<td>Equivalent</td>
<td>Result</td>
</tr>
<tr>
<td>+=</td>
<td>a += 2</td>
<td>a = a + 2</td>
<td>5</td>
</tr>
<tr>
<td>-=</td>
<td>a -= 2</td>
<td>a = a &#8211; 2</td>
<td>1</td>
</tr>
<tr>
<td>*=</td>
<td>a *= 2</td>
<td>a = a * 2</td>
<td>6</td>
</tr>
<tr>
<td>/=</td>
<td>a /= 2</td>
<td>a = a / 2</td>
<td>1</td>
</tr>
<tr>
<td>%=</td>
<td>a %= 2</td>
<td>a = a % 2</td>
<td>1</td>
</tr>
</table>
<h4>Increment / Decrement ( ++ / &#8211; - )</h4>
<p>The usage of compound assignments in c can be further simplified if it is += 1 or -= 1.</p>
<p>Assume</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">a <span style="color: #339933;">=</span> <span style="color: #0000dd;">4</span><span style="color: #339933;">;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">a<span style="color: #339933;">++;</span> <span style="color: #666666; font-style: italic;">//For Increasing the variable by 1. Final value a = 5.</span>
a<span style="color: #339933;">--;</span> <span style="color: #666666; font-style: italic;">//For Decreasing the variable by 1. Final Value a = 3.</span></pre></div></div>

<p>This means that</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">a<span style="color: #339933;">++;</span>
a<span style="color: #339933;">+=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
a<span style="color: #339933;">=</span>a<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span></pre></div></div>

<p>All provides the same values.</p>
<p>How ever there is a small difference with the increment and decrement operators. These operators can be used as a prefix or suffix.<br />
If used as a suffix,</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include&lt;stdio.h&gt;</span>
main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
      <span style="color: #993333;">int</span> a <span style="color: #339933;">=</span> <span style="color: #0000dd;">2</span><span style="color: #339933;">,</span>b<span style="color: #339933;">;</span>
      b <span style="color: #339933;">=</span> a<span style="color: #339933;">++;</span>
      <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%d&quot;</span><span style="color: #339933;">,</span> b<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      getch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span></pre></div></div>

<p>The result will be 2. Because what it does is assign first the value of <strong>a</strong>, which is 2, to <strong>b</strong> before it adds 1 to <strong>a</strong>.</p>
<p>If used as a prefix,</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include&lt;stdio.h&gt;</span>
main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
      <span style="color: #993333;">int</span> a <span style="color: #339933;">=</span> <span style="color: #0000dd;">2</span><span style="color: #339933;">,</span>b<span style="color: #339933;">;</span>
      b <span style="color: #339933;">=</span> <span style="color: #339933;">++</span>a<span style="color: #339933;">;</span>
      <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%d&quot;</span><span style="color: #339933;">,</span> b<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      getch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span></pre></div></div>

<p>The result will be 3. Because what it does is add 1 to <strong>a</strong> first before assigning the value to <strong>b</strong>.<!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itechsociety.com/2010/11/c-programming-tutorial-6-assignment-operator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.itechsociety.com/2010/11/c-programming-tutorial-6-assignment-operator/</feedburner:origLink></item>
		<item>
		<title>C Programming Tutorial 5 – More on C Variables Part 2</title>
		<link>http://feedproxy.google.com/~r/ITechSociety/~3/4rSvgNEy6rE/</link>
		<comments>http://www.itechsociety.com/2010/11/c-programming-tutorial-5-%e2%80%93-more-on-c-variables-part-2/#comments</comments>
		<pubDate>Sun, 14 Nov 2010 10:34:10 +0000</pubDate>
		<dc:creator>chicoi08</dc:creator>
				<category><![CDATA[C/C#/C++]]></category>
		<category><![CDATA[Lessons]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[double]]></category>
		<category><![CDATA[identifiers]]></category>
		<category><![CDATA[long]]></category>
		<category><![CDATA[short]]></category>
		<category><![CDATA[values]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://www.itechsociety.com/?p=909</guid>
		<description><![CDATA[Even More Data Types of C Language There might a time that you will be needing even more complex usage of c variables. If that happens then you might be wanting to consider the following data types. Data Type C &#8230; <a href="http://www.itechsociety.com/2010/11/c-programming-tutorial-5-%e2%80%93-more-on-c-variables-part-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/peeSQjroeIFXeRaoDYKxSYpP2c8/0/da"><img src="http://feedads.g.doubleclick.net/~a/peeSQjroeIFXeRaoDYKxSYpP2c8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/peeSQjroeIFXeRaoDYKxSYpP2c8/1/da"><img src="http://feedads.g.doubleclick.net/~a/peeSQjroeIFXeRaoDYKxSYpP2c8/1/di" border="0" ismap="true"></img></a></p><p><span id="more-909"></span><br />
<h4>Even More Data Types of C Language</h4>
<p>There might a time that you will be needing even more complex usage of c variables. If that happens then you might be wanting to consider the following data types.</p>
<table>
<tbody>
<tr>
<td>Data Type</td>
<td>C Data Type</td>
<td>Range</td>
</tr>
<tr>
<td>Shorter Integer</td>
<td>short int</td>
<td>signed: -32,768 to 32,767<br />
unsigned: 0 to 65,535</td>
</tr>
<tr>
<td>Interger</td>
<td>int</td>
<td>signed: -2,147,483,648 to 2,147,483,647<br />
unsigned: 0 to 4294967295</td>
</tr>
<tr>
<td>Longer Interger</td>
<td>long int</td>
<td>signed: -2,147,483,648 to 2,147,483,647<br />
unsigned: 0 to 4,294,967,295</td>
</tr>
<tr>
<td>Floating Point</td>
<td>float</td>
<td>+/- 3.4e +/- 38 (~7 digits)</td>
</tr>
<tr>
<td>Double Float</td>
<td>double</td>
<td>+/- 1.7e +/- 308 (~15 digits)</td>
</tr>
<tr>
<td>Longer Double</td>
<td>long double</td>
<td>+/- 1.7e +/- 308 (~15 digits)</td>
</tr>
<tr>
<td>String</td>
<td>char</td>
<td>hello, world, 223hi, Mr. Chicoi</td>
<td></td>
</tr>
<tr>
<td>Character</td>
<td>char</td>
<td>H, m, 8, $</td>
<td></td>
</tr>
</tbody>
</table>
<h4>Usage</h4>
<p>As you see there are new terms such as long, signed and unsigned, and double. These new keywords are used in declaring variables to expand the variable&#8217;s ability to hold values.</p>
<p>Money is a good example value to store into our variable.<br />
Take a look at the following examples.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> money<span style="color: #339933;">;</span></pre></div></div>

<p>Declaring the variable money as int will limit its value to these range of numbers, from -2,147,483,648 to 2,147,483,647. Sometimes -32,768 to 32,767 depending on your compiler. Instead of doing this, we can declare it as</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">long</span> <span style="color: #993333;">int</span> money<span style="color: #339933;">;</span></pre></div></div>

<p>This will ensure that the value&#8217;s range can be from -2,147,483,648 to 2,147,483,647. We can further increase its possible maximum value by eliminating the negative values giving us numbers from 0 to 4,294,967,295.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">unsigned</span> <span style="color: #993333;">long</span> <span style="color: #993333;">int</span> money<span style="color: #339933;">;</span></pre></div></div>

<h4>Initializing Variable Values</h4>
<p>When we declare variables, its initial values are defaulted as undefined or undetermined. You can do this in 2 different ways. The first one is at the moment you declared the variable or after declaration and before anything else.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> money<span style="color: #339933;">=</span><span style="color: #0000dd;">123321</span><span style="color: #339933;">;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> money<span style="color: #339933;">;</span>
money <span style="color: #339933;">=</span> <span style="color: #0000dd;">123321</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>NOTE</strong>: In declaring numbers as the variable&#8217;s value, don&#8217;t enclose it with quotes or double quotes<!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itechsociety.com/2010/11/c-programming-tutorial-5-%e2%80%93-more-on-c-variables-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.itechsociety.com/2010/11/c-programming-tutorial-5-%e2%80%93-more-on-c-variables-part-2/</feedburner:origLink></item>
		<item>
		<title>How to – Change My Ip Address</title>
		<link>http://feedproxy.google.com/~r/ITechSociety/~3/ExiSzsHPZuk/</link>
		<comments>http://www.itechsociety.com/2010/11/how-to-change-my-ip/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 02:04:23 +0000</pubDate>
		<dc:creator>chicoi08</dc:creator>
				<category><![CDATA[How Tos]]></category>
		<category><![CDATA[Screencast]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[ip address]]></category>

		<guid isPermaLink="false">http://www.itechsociety.com/?p=816</guid>
		<description><![CDATA[Reality Actually You cannot change your Web IP Address. Your Internet Service Provider(ISP) is the one who controls your IP address. It is either you have a dynamic IP or a static IP. A dynamic IP changes according to schedule &#8230; <a href="http://www.itechsociety.com/2010/11/how-to-change-my-ip/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/yU8bRhztCO01VDkAOxBcrD_XXgw/0/da"><img src="http://feedads.g.doubleclick.net/~a/yU8bRhztCO01VDkAOxBcrD_XXgw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/yU8bRhztCO01VDkAOxBcrD_XXgw/1/da"><img src="http://feedads.g.doubleclick.net/~a/yU8bRhztCO01VDkAOxBcrD_XXgw/1/di" border="0" ismap="true"></img></a></p><p><span id="more-816"></span></p>
<div id="attachment_817" class="wp-caption aligncenter" style="width: 335px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/youtube_country_restriction.jpg" rel="lightbox[816]" title="youtube_country_restriction"><img class="size-full wp-image-817" title="youtube_country_restriction" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/youtube_country_restriction.jpg" alt="youtube_country_restriction" width="325" height="117" /></a><p class="wp-caption-text">Youtube Country Restriction</p></div>
<h5>Reality</h5>
<p>Actually You cannot change your Web IP Address. Your Internet Service Provider(ISP) is the one who controls your IP address. It is either you have a dynamic IP or a static IP. A dynamic IP changes according to schedule or according to rules of the ISP and a static IP is an IP that doesn&#8217;t change. Sometimes your IP changes when turned off your modem, sometimes every after 24 hours.</p>
<p>What you can really change is your Proxy. First let&#8217;s see and example result after changing your proxy settings. I visited whatismyipaddress.com to see what is my current detected IP and country. And let me clarify things, I&#8217;m living here in the Philippines. This is the result.</p>
<div id="attachment_821" class="wp-caption aligncenter" style="width: 357px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/afterproxy-change.png" rel="lightbox[816]" title="afterproxy-change"><img class="size-full wp-image-821" title="afterproxy-change" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/afterproxy-change.png" alt="Web IP Address After Changing Proxy Settings" width="347" height="243" /></a><p class="wp-caption-text">Web IP Address After Changing Proxy Settings</p></div>
<div id="attachment_822" class="wp-caption aligncenter" style="width: 357px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/beforeproxy-change.png" rel="lightbox[816]" title="beforeproxy-change"><img class="size-full wp-image-822" title="beforeproxy-change" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/beforeproxy-change.png" alt="My Current Web IP Address" width="347" height="243" /></a><p class="wp-caption-text">My Current Web IP Address</p></div>
<p>So how can we achieve this? This settings is done by changing the browser settings. Before anything else, we need a free proxy that we can use. Checkout <a href="http://adf.ly/AbiG" target="_blank">this website</a>. You will be prompted with fresh list of IP addresses together with their port, country, speed, and connection time.</p>
<div id="attachment_827" class="wp-caption aligncenter" style="width: 812px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/freeproxy.png" rel="lightbox[816]" title="freeproxy"><img class="size-full wp-image-827" title="freeproxy" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/freeproxy.png" alt="free proxy" width="802" height="323" /></a><p class="wp-caption-text">Free Proxy</p></div>
<p>You can now choose and write down in your paper almost any of the IPs that you can see in the list. But don&#8217;t pick the ones with a PL next to it. Those are paid IP servers. Just remember that your connection speed will be affected with this process so you must also consider the speed and the connection time of each IPs.</p>
<h5>The Set-Up</h5>
<p><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/mozillalogo.png" rel="lightbox[816]" title="mozillalogo"><img class="size-full wp-image-825 alignleft" title="mozillalogo" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/mozillalogo.png" alt="Mozilla Firefox Logo" width="121" height="124" /></a><strong> Mozilla Firefox:</strong></p>
<p>Go to tools&gt;Options&#8230;&gt;Network tab&gt;Settings</p>
<p>There you will see the your current connection settings.</p>
<div id="attachment_824" class="wp-caption aligncenter" style="width: 610px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/mozilla.png" rel="lightbox[816]" title="mozilla"><img class="size-full wp-image-824" title="mozilla" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/mozilla.png" alt="Mozilla Proxy Settings" width="600" /></a><p class="wp-caption-text">Mozilla Proxy Settings</p></div>
<p>Select Manual Proxy Settings and paste or type in the IP address that you have chosen. Don&#8217;t forget to check the option, &#8220;Use this proxy server for all protocols&#8221;, and type in the port too!</p>
<div id="attachment_832" class="wp-caption aligncenter" style="width: 462px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/setproxy.png" rel="lightbox[816]" title="setproxy"><img class="size-full wp-image-832" title="setproxy" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/setproxy.png" alt="setproxy" width="452" height="475" /></a><p class="wp-caption-text">Set-up proxy</p></div>
<p>Click OK and then check your IP at whatismyipaddress.com to see the changes.</p>
<p style="text-align: center;"><img class="size-full wp-image-837  aligncenter" title="chrome" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/chrome.png" alt="" width="132" height="125" /></p>
<p><strong>Google Chrome:</strong><br />
For Dial-Up connection: Click on the settings icon &gt; Options &gt; Under the Hood tab &gt; Network &gt; Change Proxy Settings &gt; Connections Tab &gt; Select Your network &gt; Settings &gt; Proxy Server Box &gt; Check &#8220;Use a proxy server&#8230;&#8221; and &#8220;Bypass proxy server&#8230;&#8221; &gt; Type in your chosen IP address and its corresponding Port. &gt; Click OK &gt; OK again.</p>
<p>For other connection: Click on the settings icon &gt; Options &gt; Under the Hood tab &gt; Network &gt; Change Proxy Settings &gt; Connections Tab &gt; LAN Settings &gt; Proxy Server Box &gt; Check &#8220;Use a proxy server&#8230;&#8221; and &#8220;Bypass proxy server&#8230;&#8221; &gt; Type in your chosen IP address and its corresponding Port. &gt; Click OK &gt; OK again.</p>
<p style="text-align: center;"><img class="size-full wp-image-838    aligncenter" title="internetexplorer" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/internetexplorer.png" alt="" width="132" height="125" /></p>
<p><strong>Internet Explorer:</strong><br />
Click on the tools &gt; Internet Options &gt; Connections Tab &gt; Select Your network &gt; Settings &gt; Proxy Server Box &gt; Check &#8220;Use a proxy server&#8230;&#8221; and &#8220;Bypass proxy server&#8230;&#8221; &gt; Type in your chosen IP address and its corresponding Port. &gt; Click OK &gt; OK again.</p>
<p style="text-align: center;"><img class="size-full wp-image-841    aligncenter" title="opera" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/opera.png" alt="Opera" width="132" height="125" /></p>
<p><strong>Opera:</strong><br />
Click on Menu &gt; Settings &gt; Preferrences &gt; Advance Tabs &gt; Network &gt; Proxy Servers &gt; Check &#8220;HTTP&#8221; &gt; Enter your chosen IP address and its corresponding port. &gt; Click OK &gt; OK again.</p>
<h4>Reverting Back to Normal</h4>
<p>It&#8217;s important to revert back to normal everyday or every time that your connection is having error after changing IP address. To revert back just do again what you have done but uncheck your manual proxy settings and then be sure to save changes. After that your good to go.</p>
<p>That&#8217;s it.<!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itechsociety.com/2010/11/how-to-change-my-ip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.itechsociety.com/2010/11/how-to-change-my-ip/</feedburner:origLink></item>
		<item>
		<title>C Programming Tutorial 5 – More on C Variables</title>
		<link>http://feedproxy.google.com/~r/ITechSociety/~3/K4n2bdLwtig/</link>
		<comments>http://www.itechsociety.com/2010/11/c-programming-tutorial-5-more-on-c-variables/#comments</comments>
		<pubDate>Sat, 06 Nov 2010 15:27:25 +0000</pubDate>
		<dc:creator>chicoi08</dc:creator>
				<category><![CDATA[C/C#/C++]]></category>
		<category><![CDATA[Lessons]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[identifiers]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://www.itechsociety.com/?p=768</guid>
		<description><![CDATA[Do you still remember this? We already discussed few things about variables in the previous lesson. We have learned how to assign an integer to a variable x and display it. We also learned that we need to declare a &#8230; <a href="http://www.itechsociety.com/2010/11/c-programming-tutorial-5-more-on-c-variables/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/dhqspcgAWO1Tx-ZORZQMdnfCBQ8/0/da"><img src="http://feedads.g.doubleclick.net/~a/dhqspcgAWO1Tx-ZORZQMdnfCBQ8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/dhqspcgAWO1Tx-ZORZQMdnfCBQ8/1/da"><img src="http://feedads.g.doubleclick.net/~a/dhqspcgAWO1Tx-ZORZQMdnfCBQ8/1/di" border="0" ismap="true"></img></a></p><p><span id="more-768"></span>Do you still remember this?</p>
<div id="attachment_493" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/09/figure12.gif" rel="lightbox[768]" title="Figure 1.0"><img class="size-full wp-image-493" title="Figure 1.0" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/09/figure12.gif" alt="Using Variables" width="500" height="146" /></a><p class="wp-caption-text">Figure 1.0 - Using Variables</p></div>
<p>We already discussed few things about variables in the <a href="http://www.itechsociety.com/tutorials/programming/ccc/lessons/c-lesson-2-intro-to-variables/" target="_self">previous lesson</a>. We have learned how to assign an integer to a variable x and display it. We also learned that we need to declare a variable before we can use it in our c programs. We are now going in more in depth in <strong>working with variables</strong>.</p>
<h4>Identifiers:</h4>
<p>As we see in the figure above, we used x as our variable to store the phrase &#8220;baked mac&#8221;. The variable <strong>x </strong>is also called an identifier.</p>
<h5>Naming Variables</h5>
<p>There are several rules that we have to remember when <strong>naming</strong> our own <strong>identifier</strong>.</p>
<ol>
<li>It can only contain letters, number digits, and underscore</li>
<li>It should not begin with a number</li>
<li>It cannot contain spaces</li>
<li>It is case sensitive. This means that variables like <strong>X</strong> and <strong>x</strong> are completely different.</li>
<li>We cannot use any C language keywords as variable names.</li>
</ol>
<div id="attachment_786" class="wp-caption aligncenter" style="width: 410px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/figure2.png" rel="lightbox[768]" title="Figure 2"><img class="size-full wp-image-786" title="Figure 2" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/11/figure2.png" alt="Figure 2.0 - variable names" width="400" height="200" /></a><p class="wp-caption-text">Figure 2.0 - Variable Names</p></div>
<h4>C language keywords:</h4>
<p>Here are the keywords that we cannot use as our variable names.</p>
<blockquote><p>asm, auto, break, case, catch, char, class, const, const_cast, continue, default, do, double, dynamic_cast, else, enum, explicit, export, extern, false, float, for, delete, friend, goto, if, inline, int, long, mutable, namespace, new, operator, private, protected, public, register, reinterpret_cast, return, short, signed, sizeof, static, static_cast, struct, switch, template, this, throw, true, try, typedef, typeid, typename, union, unsigned, using, void, volatile, wchar_t, while, bool, virtual</p></blockquote>
<p>Some compilers can also contain some more keywords other than the ones listed above.</p>
<p>Correct Naming Examples:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> num1<span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> user_age<span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> x<span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> diff<span style="color: #339933;">;</span></pre></div></div>

<p>Wrong Naming Examples:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//this is a c keyword</span>
<span style="color: #993333;">int</span> 1stname<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//this begins with a number digit</span>
<span style="color: #993333;">int</span> <span style="color: #339933;">#x; //this one uses a special character</span>
<span style="color: #993333;">int</span> average grade<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//use of space is not allowed</span></pre></div></div>

<h4>Declaring Variables</h4>
<p>We have to declare all the variables that we want to use before we can actually use it in our c programs. So knowing how to declare them properly is a big deal.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> num1<span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> user_age<span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> x<span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> diff<span style="color: #339933;">;</span></pre></div></div>

<p>The code above declares 3 different variables. As we see, all of them are declared as int. We can also group them making a single statement that is the same as the above statements.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> num1<span style="color: #339933;">,</span> user_age<span style="color: #339933;">,</span> x<span style="color: #339933;">,</span> diff<span style="color: #339933;">;</span></pre></div></div>

<h4>C Data Types</h4>
<p>When we program we may encounter different types of data that we have to store in a variable. It can be an integer, floating point, character, or string.</p>
<table>
<tbody>
<tr>
<td>Data Type</td>
<td>C Data Type</td>
<td>Example data</td>
<td>Identifier</td>
</tr>
<tr>
<td>Integer</td>
<td>int</td>
<td>-9, 22, 0 12322,-2230</td>
<td>%d</td>
</tr>
<tr>
<td>Floating Point</td>
<td>float</td>
<td>5.539, 9.0, -23.4223, +2.2223</td>
<td>%f</td>
</tr>
<tr>
<td>Character</td>
<td>char</td>
<td>S, w, %, 8</td>
<td>%c</td>
</tr>
<tr>
<td>String</td>
<td>char</td>
<td>hello, world, 223hi, Mr. Chicoi</td>
<td>%s</td>
</tr>
</tbody>
</table>
<h4>How to classify data types?</h4>
<p><strong>Integer</strong> (int)- this is used if the data provided is either negative numbers or whole numbers(0,1,2,3,&#8230;)</p>
<p><strong>Float</strong> (float)- this is used if the data provided contains decimal places</p>
<p><strong>Character </strong>(char)- this is used if the data given contains a single character.</p>
<p><strong>String</strong> (char)- this used if the data given contains both numbers, letters, spaces, and special characters.</p>
<p>After learning the different type of data that we can use to a c language, we must also learn when and how to use them. Lets take a look at the following problem.</p>
<blockquote><p>Create a program that will collect the user&#8217;s age, gender, name, and address. Use M or F for gender.</p></blockquote>
<p>Example output:</p>
<pre>age: 19
gender [M/F]: M
name: chicoi
address: #23 space ave Unknown universe, Missing galaxy 2231</pre>
<p>To solve this problem we must first analyze the data types.<br />
We are asked to collect the following information from the user:</p>
<ol>
<li><span style="font-size: 13px; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px;">Age</span></li>
<li><span style="font-size: 13px; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px;">Gender (M/F)</span></li>
<li><span style="font-size: 13px; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px;">Name</span></li>
<li><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: small;"><span style="line-height: 19px;">Address</span></span></li>
</ol>
<p><strong>Age</strong> can be declared as int because we don&#8217;t actually need ages like 7.5 or 18.2. a whole number is fine.</p>
<p>For the <strong>Gender </strong>we can make use of char because we just need a single character.</p>
<p>For the <strong>Name</strong> and the <strong>Address</strong> we should make use of string because it may contain numbers, spaces, special characters, and letters.</p>
<h4>Usage</h4>
<p>Declaring Integers:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> age<span style="color: #339933;">;</span></pre></div></div>

<p>Declaring Single Character:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">char</span> gender<span style="color: #339933;">;</span></pre></div></div>

<p>Declaring String</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">char</span> name<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">30</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> address<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">50</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

<p>As you see the only difference of declaring a string and declaring a char is that the after the variable name it has square brackets with numbers in between. This is the one that determine how long your string will be. The number represent the number of characters you can use as input. Meaning, if you want to store a name that is 20 characters long, you must declare the variable like this:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">char</span> name<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">21</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

<p>More about strings <a href="http://www.google.com/cse?cx=partner-pub-7013454021708520:uiyp766182q&amp;ie=UTF-8&amp;q=c+strings&amp;sa=Search&amp;siteurl=www.itechsociety.com/tutorials/programming/ccc/lessons/c-programming-tutorial-5-more-on-c-variables/%3Fpreview%3Dtrue%26preview_id%3D768%26preview_nonce%3D94dbc75c92">here</a>.<!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itechsociety.com/2010/11/c-programming-tutorial-5-more-on-c-variables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.itechsociety.com/2010/11/c-programming-tutorial-5-more-on-c-variables/</feedburner:origLink></item>
		<item>
		<title>Alpha Test Update: How About a New Design?</title>
		<link>http://feedproxy.google.com/~r/ITechSociety/~3/qxN4ph92AhY/</link>
		<comments>http://www.itechsociety.com/2010/10/alpha-test-update-how-about-a-new-design/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 12:55:09 +0000</pubDate>
		<dc:creator>chicoi08</dc:creator>
				<category><![CDATA[News & Announcements]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.itechsociety.com/?p=731</guid>
		<description><![CDATA[After Several weeks of planning and creating, the new ITechSociety.com design is now almost done. As part of the Alpha test Phase 2 this theme is now under test. If you found anything wrong with how the theme works please &#8230; <a href="http://www.itechsociety.com/2010/10/alpha-test-update-how-about-a-new-design/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/A1KkIfTOpN1QBkDB78Apr-NvXio/0/da"><img src="http://feedads.g.doubleclick.net/~a/A1KkIfTOpN1QBkDB78Apr-NvXio/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/A1KkIfTOpN1QBkDB78Apr-NvXio/1/da"><img src="http://feedads.g.doubleclick.net/~a/A1KkIfTOpN1QBkDB78Apr-NvXio/1/di" border="0" ismap="true"></img></a></p><p>After Several weeks of planning and creating, the new ITechSociety.com design is now almost done. As part of the Alpha test Phase 2 this theme is now under test.<span id="more-731"></span> If you found anything wrong with <strong>how the theme works</strong> please feel free to leave a message below.</p>
<p>Any comments and suggestions is highly appreciated.</p>
<p>ITechSociety.com Theme Progress</p>
<div id="attachment_734" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/10/homepage.jpg" rel="lightbox[731]" title="homepage"><img class="size-medium wp-image-734" title="homepage" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/10/homepage-300x156.jpg" alt="" width="300" height="156" /></a><p class="wp-caption-text">1st Home Page Design</p></div>
<div id="attachment_735" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/10/look2.jpg" rel="lightbox[731]" title="look2"><img class="size-medium wp-image-735" title="look2" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/10/look2-300x160.jpg" alt="2nd Design" width="300" height="160" /></a><p class="wp-caption-text">2nd Design</p></div>
<p><div id="attachment_733" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/10/look3.jpg" rel="lightbox[731]" title="look3"><img class="size-medium wp-image-733" title="look3" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/10/look3-300x160.jpg" alt="" width="300" height="160" /></a><p class="wp-caption-text">3rd look</p></div> <!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itechsociety.com/2010/10/alpha-test-update-how-about-a-new-design/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.itechsociety.com/2010/10/alpha-test-update-how-about-a-new-design/</feedburner:origLink></item>
		<item>
		<title>C Programming Examples – Range of Numbers</title>
		<link>http://feedproxy.google.com/~r/ITechSociety/~3/jh2yvWE-NTE/</link>
		<comments>http://www.itechsociety.com/2010/10/c-programming-examples-range-of-numbers/#comments</comments>
		<pubDate>Thu, 21 Oct 2010 13:27:06 +0000</pubDate>
		<dc:creator>chicoi08</dc:creator>
				<category><![CDATA[C/C#/C++]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[for loop]]></category>
		<category><![CDATA[range]]></category>

		<guid isPermaLink="false">http://www.itechsociety.com/?p=600</guid>
		<description><![CDATA[Example Output 1 Enter the starting number: 5 Enter the ending number: 10 5 6 7 8 9 10 Example Output 2 Enter the starting number: 13 Enter the ending number: 2 13 12 11 10 9 8 7 6 &#8230; <a href="http://www.itechsociety.com/2010/10/c-programming-examples-range-of-numbers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/sl80xPlx4qqu5pG3U0PWNvXx0IY/0/da"><img src="http://feedads.g.doubleclick.net/~a/sl80xPlx4qqu5pG3U0PWNvXx0IY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/sl80xPlx4qqu5pG3U0PWNvXx0IY/1/da"><img src="http://feedads.g.doubleclick.net/~a/sl80xPlx4qqu5pG3U0PWNvXx0IY/1/di" border="0" ismap="true"></img></a></p><p><strong>Example Output 1 </strong></p>
<pre>Enter the starting number: 5
Enter the ending number: 10

5 6 7 8 9 10</pre>
<p><span id="more-600"></span><br />
<strong>Example Output 2 </strong></p>
<pre>Enter the starting number: 13
Enter the ending number: 2

13 12 11 10 9 8 7 6 5 4 3 2</pre>
<p><strong>Solution: </strong></p>
<p>Simple problem right? But how can we actually do this? Let&#8217;s first Identify the flow or step by step procedure(algorithm).</p>
<ol>
<li>The first thing we do is to know what are the starting and ending numbers.</li>
<li>Then we determine what? We determine which of the 2 numbers is greater.</li>
<li>If the starting number is less than the second number then what we do is print this number and then increase the number by 1 until we reach the second number.</li>
<li>If the first number is greater than the second number, we first print this starting number and then decrease the number by 1 until we reach the second number.</li>
</ol>
<p>Here&#8217;s the program flow illustrated using a flow chart.</p>
<div id="attachment_609" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/10/figure110.gif" rel="lightbox[600]" title="figure1"><img class="size-medium wp-image-609" title="figure1" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/10/figure110-300x223.gif" alt="Flow chart of ranging numbers" width="300" height="223" /></a><p class="wp-caption-text">Figure 1.0 - Range of Numbers</p></div>
<p>As you see we are repeating the process of incrementing or decrementing as well as printing the current values of CTR. In with this illustration we can now say that using any loop statement can do the job.</p>
<p>That&#8217;s it! Pretty simple.</p>
<p>Next step is to try and translate it to a process which our compiler can understand.</p>
<p><strong>Source Code Building</strong></p>
<p>First things we need are the variables for our program. In this case we need 2 variables for the user input of the starting number and ending number, and another for tracking our number as it increments or decrements.</p>
<p>In this case we can use<span style="color: #ffffff;"> </span><span style="color: #ffffff;">num1</span> for the starting number and</p>
<p><span style="color: #ffffff;"> num2</span> for the ending number.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> num1<span style="color: #339933;">,</span> num2<span style="color: #339933;">;</span></pre></div></div>

<p>The next thing we have to do after the user placed the values  is determine if the value of num1 is less than the value of num2.</p>
<p>If the value of<strong> num1 is less than num2 </strong>this means what what we have to output is an <strong>incrementing value from what ever is the initial value of num1</strong>.</p>
<p>We can do all of this things by using a for loop statement. This will save us some space because a for loop statement does the initiation, condition, and incrementing of values.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>ctr <span style="color: #339933;">=</span> num1<span style="color: #339933;">;</span> ctr <span style="color: #339933;">&lt;=</span> num2<span style="color: #339933;">;</span> ctr<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p><span style="color: #339966;">ctr = num1</span> &#8211; this is the one responsible for assigning the initial value of num1 to ctr.</p>
<p><span style="color: #339966;">ctr &lt;= num2</span> &#8211; this line is the one <strong>responsible for determining if the current value of ctr is less than our ending value </strong>that is stored in <span style="color: #ff0000;"><span style="color: #ffffff;">num2</span><span style="color: #888888;">.</span></span></p>
<p><span style="color: #339966;">ctr++</span> &#8211; <strong>this will increase the value of ctr by 1 after executing everything in the loop</strong>. And because this is the only variable that changes as the loop goes, and it is equal to what we are looking for, we can print out its values as our result.</p>
<p>What we want to do during the loop is print the value of ctr. So inside our for statement is this line of code:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%d &quot;</span><span style="color: #339933;">,</span> ctr<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The code above will do its job if and only if the value of <span style="color: #ffffff;">num1</span> is less than or equal to the value of <span style="color: #ffffff;">num2</span>.</p>
<p>For the condition of displaying number if the starting value is greater than the ending value. It is actually simple and almost the same. In this case all we have to do is create a new for loop statement that will determine if it is greater than the ending number. If the condition sees that the starting number is greater than the ending number, then we have to decrement the value and print ctr until its equal to the 2nd number.</p>
<p>Now try the program, it should work fine.</p>
<p>If you enter 2 equal numbers, It will display 2 numbers too. So how can we fix that? we can make use of some if else statements.</p>
<p>If the numbers are equal we simply print one of them. If not, then we do looping.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>num1 <span style="color: #339933;">=</span> num2<span style="color: #009900;">&#41;</span>
     <span style="color: #009900;">&#123;</span>
          <span style="color: #808080; font-style: italic;">/*Print any of the two values.*/</span>
     <span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
     <span style="color: #009900;">&#123;</span>
          <span style="color: #808080; font-style: italic;">/*Do the looping.*/</span>
     <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Final Source Code:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include&lt;stdio.h&gt;</span>
&nbsp;
main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">//Declare all the variables we need</span>
      <span style="color: #993333;">int</span> num1<span style="color: #339933;">,</span> num2<span style="color: #339933;">,</span> ctr<span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #808080; font-style: italic;">/*Accept values for variables starting and
      ending numbers*/</span>
      <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Enter starting number: &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      scanf<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%d&quot;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>num1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Enter ending number: &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      scanf<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%d&quot;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>num2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>      
&nbsp;
      <span style="color: #666666; font-style: italic;">//Determine if the values are equal or not</span>
      <span style="color: #666666; font-style: italic;">//If num1 is not equal to num2 proceed</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>num1 <span style="color: #339933;">!=</span> num2<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
               <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>ctr <span style="color: #339933;">=</span> num1<span style="color: #339933;">;</span> ctr <span style="color: #339933;">&lt;=</span> num2<span style="color: #339933;">;</span> ctr<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
                       <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%d &quot;</span><span style="color: #339933;">,</span>ctr<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
               <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>ctr <span style="color: #339933;">=</span> num1<span style="color: #339933;">;</span> ctr <span style="color: #339933;">&gt;=</span> num2<span style="color: #339933;">;</span> ctr<span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span>
                       <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%d &quot;</span><span style="color: #339933;">,</span>ctr<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
               <span style="color: #009900;">&#125;</span>
      <span style="color: #666666; font-style: italic;">//If num1 is equal to num2 just print the value of num1</span>
      <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
               <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%d&quot;</span><span style="color: #339933;">,</span> num1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
           <span style="color: #009900;">&#125;</span>
&nbsp;
      getch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span></pre></div></div>

<p><!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itechsociety.com/2010/10/c-programming-examples-range-of-numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.itechsociety.com/2010/10/c-programming-examples-range-of-numbers/</feedburner:origLink></item>
		<item>
		<title>C Programming Examples – Comparing 2 numbers – Simple If Else if Else problem</title>
		<link>http://feedproxy.google.com/~r/ITechSociety/~3/Q8ViBbpDU5c/</link>
		<comments>http://www.itechsociety.com/2010/10/c-programming-examples-%e2%80%93comparing-2-numbers-simple-if-else-if-else-problem/#comments</comments>
		<pubDate>Thu, 14 Oct 2010 07:07:32 +0000</pubDate>
		<dc:creator>chicoi08</dc:creator>
				<category><![CDATA[C/C#/C++]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[comparing]]></category>
		<category><![CDATA[greater]]></category>
		<category><![CDATA[less than]]></category>

		<guid isPermaLink="false">http://www.itechsociety.com/?p=535</guid>
		<description><![CDATA[Example Output 1 Enter 1st num: 2.5 Enter 2nd num: 2.4 The 1st number is greater than 2nd number. Example Output 2 Enter 1st num: 3 Enter 2nd num: 3.1 The 1st number is less than 2nd number. Example Output &#8230; <a href="http://www.itechsociety.com/2010/10/c-programming-examples-%e2%80%93comparing-2-numbers-simple-if-else-if-else-problem/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/BjIJS0ieCB0VODPRm7CrlRLqsUI/0/da"><img src="http://feedads.g.doubleclick.net/~a/BjIJS0ieCB0VODPRm7CrlRLqsUI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/BjIJS0ieCB0VODPRm7CrlRLqsUI/1/da"><img src="http://feedads.g.doubleclick.net/~a/BjIJS0ieCB0VODPRm7CrlRLqsUI/1/di" border="0" ismap="true"></img></a></p><p><strong>Example Output 1 </strong></p>
<pre>Enter 1st num: 2.5
Enter 2nd num: 2.4

The 1st number is greater than 2nd number.</pre>
<p><span id="more-535"></span><br />
<strong>Example Output 2 </strong></p>
<pre>Enter 1st num: 3
Enter 2nd num: 3.1

The 1st number is less than 2nd number.</pre>
<p><strong>Example Output 3 </strong></p>
<pre>Enter 1st num: 3
Enter 2nd num: 3.0

The 1st number is equal to the 2nd number.</pre>
<p><div id="attachment_577" class="wp-caption aligncenter" style="width: 410px"><a href="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/10/figure19.gif" rel="lightbox[535]" title="figure1"><img class="size-full wp-image-577" title="figure1" src="http://www.gpttemplates.com/itechsociety.com/wp-content/uploads/2010/10/figure19.gif" alt="Determine equality of 2 numbers" width="400" height="143" /></a><p class="wp-caption-text">Figure 1.0 - Sample Output</p></div><br />
Solution:</p>
<p>How can you say that a number is greater than another number? It&#8217;s by comparing them. Then after comparing them we determine if the 1st number is more, less, or if it is equal. By creating conditions we can we can achieve this. Let&#8217;s list down the step by step procedure.</p>
<ol>
<li>We first accept the 2 numbers.</li>
<li>Then compare the first number to the second number.</li>
<li>We determine what to print out using the following conditions:</li>
</ol>
<ul>
<li>If 1st number is greater than the 2nd number print:</li>
</ul>
<pre>The 1st number is greater than 2nd number.</pre>
<ul>
<li>If 1st number is lesser than the 2nd number print:</li>
</ul>
<pre>The 1st number is lesser than 2nd number.</pre>
<ul>
<li>If 1st number is equal to 2nd number print:</li>
</ul>
<pre>The 1st number is equal to 2nd number.</pre>
<p>Let us now translate this steps into source code.</p>
<p>Let us declare first the 2 variables as num1 and num2.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">float</span> num1<span style="color: #339933;">,</span> num2<span style="color: #339933;">;</span></pre></div></div>

<p>Why I have used float? It is because our example output shows that the user can enter numbers with fractions.</p>
<p>The next thing we have to do after the user placed the 2 values is do the condition. We can first try if num1 is greater than num2.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>num1 <span style="color: #339933;">&lt;</span> num2<span style="color: #009900;">&#41;</span>
     <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;The 1st number is greater than 2nd number.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>num1 <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> num2<span style="color: #009900;">&#41;</span>
     <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;nThe 1st number is less than 2nd number.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span>
     <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;nThe 1st number is equal to the 2nd number.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The Final Source Code:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include&lt;stdio.h&gt;</span>
&nbsp;
main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>        
        <span style="color: #666666; font-style: italic;">//Declare 2 variables for the 2 numbers</span>
        <span style="color: #993333;">float</span> num1<span style="color: #339933;">,</span> num2<span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">//ask the user to enter the number and then store</span>
        <span style="color: #666666; font-style: italic;">//the value to respective variables.</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Enter 1st num: &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        scanf<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%f&quot;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>num1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Enter 2nd num: &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        scanf<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%f&quot;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>num2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">//This is where the condition comes in.</span>
        <span style="color: #666666; font-style: italic;">//Exactly the same as how we say it it English</span>
        <span style="color: #666666; font-style: italic;">//Step by Step</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>num1 <span style="color: #339933;">&gt;</span> num2<span style="color: #009900;">&#41;</span>
            <span style="color: #666666; font-style: italic;">//After the condition is met lets print this,</span>
            <span style="color: #666666; font-style: italic;">//if not proceed to next condition</span>
            <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;nThe 1st number is greater than 2nd number.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>num1 <span style="color: #339933;">&lt;</span> num2<span style="color: #009900;">&#41;</span>
            <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;nThe 1st number is less than 2nd number.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">else</span>
            <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;nThe 1st number is equal to the 2nd number.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        getch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itechsociety.com/2010/10/c-programming-examples-%e2%80%93comparing-2-numbers-simple-if-else-if-else-problem/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://www.itechsociety.com/2010/10/c-programming-examples-%e2%80%93comparing-2-numbers-simple-if-else-if-else-problem/</feedburner:origLink></item>
	</channel>
</rss>

