<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Simply Dhavest - Filipino PHP Programmer &#187; Operators</title>
	<atom:link href="http://www.dhavest.com/category/phptutorial/php-operators/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dhavest.com</link>
	<description>Journal of a Filipino Programmer</description>
	<lastBuildDate>Fri, 29 Jan 2010 14:23:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Determining if a number is odd or even</title>
		<link>http://www.dhavest.com/2007/10/18/determining-if-a-number-is-odd-or-even/</link>
		<comments>http://www.dhavest.com/2007/10/18/determining-if-a-number-is-odd-or-even/#comments</comments>
		<pubDate>Thu, 18 Oct 2007 16:31:38 +0000</pubDate>
		<dc:creator>conai</dc:creator>
				<category><![CDATA[Operators]]></category>

		<guid isPermaLink="false">http://www.dhavest.com/2007/10/18/determining-if-a-number-is-odd-or-even/</guid>
		<description><![CDATA[Problem: We wanted to determine if a number is even or odd
Notes: We know that even number end with 0, 2, 4, 6, 8 and odd numbers ends with 1, 3, 5, 7, 9. So how will we know if a number given is an even or odd number in a program..
Solution:
&#60;?
$magic_number = 123568;
if($magic_number % [...]]]></description>
			<content:encoded><![CDATA[<p>Problem: We wanted to determine if a number is even or odd</p>
<p>Notes: We know that even number end with 0, 2, 4, 6, 8 and odd numbers ends with 1, 3, 5, 7, 9. So how will we know if a number given is an even or odd number in a program..</p>
<p>Solution:</p>
<pre>&lt;?</pre>
<pre>$magic_number = 123568;</pre>
<pre>if($magic_number % 2 == 0) {</pre>
<pre>    print "The number is even.";</pre>
<pre>}  else {</pre>
<pre>    print "The number is odd.";</pre>
<pre>}</pre>
<pre>?&gt;</pre>
<p>Explanation: In the program above we use the modulus division. Modulus division unlike the ordinary division (/) returns the remainder instead of the quotient. So we tried modulo dividing the given number by 2 to determine if it is divisible by 2.</p>
<p><!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dhavest.com/2007/10/18/determining-if-a-number-is-odd-or-even/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
