PHP Codeigniter MySQL Java Script JQuery Codding

Php code, Database Connections with Mysql, Java Script , Jquery, Codeigniter

Pages

  • Home
  • Codeigniter
  • Models
  • Jquery

Saturday, 29 June 2013

sum of even numbers

<html>
<head>
<title></title>
</head>
<body>
<?php
function even($sum=0)
{
for($i=0;$i<=100;$i++)
{
if($i%2==0)
{
echo $i;
print "<br/>";
$sum=$sum+$i;
}

}
echo "Sum of 1 to 100 even numbers are:"." ".$sum;
}
even();
?>
</body>
</html>
Posted by narsireddy.007 at 2:19 pm
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: sum of even numbers, sum of even numbers in php

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Popular Posts

Blog Archive

  • ►  2016 (2)
    • ►  August (1)
    • ►  July (1)
  • ►  2015 (6)
    • ►  December (1)
    • ►  August (2)
    • ►  July (2)
    • ►  April (1)
  • ►  2014 (5)
    • ►  July (1)
    • ►  June (3)
    • ►  May (1)
  • ▼  2013 (35)
    • ►  September (8)
    • ►  August (1)
    • ►  July (9)
    • ▼  June (17)
      • sum of even numbers
      • palindrome or not in php
      • for loop in php (display 1 to 10 numbers)
      • Tables in php
      • addition in php using functions
      • print odd numbers in php
      • Fibonacci series in php
      • Print even numbers in php
      • if else condition in php
      • do-while program in php
      • Arithametic operations in php
      • Amstrong in php
      • Simple examples in php
      • Addition in PHP
      • Print sample Message In PHP
      • php syntax
      • php logo

Site Views

CopyRights 2013 @Narsi Reddy@narsireddy.007@gmail.com. Picture Window theme. Powered by Blogger.