*********
  *******
   *****
     ***
       *


#include<stdio.h>

int main()
{

        int i,j,k;
 
        for(i=5;i>=1;i++)
        {
                  for(j=5;j>i;j--)
                  {

                             printf(" ");       

                   }
                   for(k=1;k<(i*2);i++)
                   {
                  
                             printf("*");

                    }
                    printf("\n");
         }

}

0
         



        *
      ***
    *****
  *******
*********




#include<stdio.h>

int main()
{
           int i,j,k;
     
           for(i=1;i<=5;i++)
          {
                     for(j=i;j<5;j++
                     {
                            printf(" ");
                      }
                      for(k=1;k<(i*2);k++
                      {
                            printf("*");
                      }
                       
                      printf("\n");
          }

}
0
Step:1 Open Dreamweaver.

Step:2 Create PHP Page



Step:3 Coding ..

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
   $x=5;
   $y=6;
   echo"<center><h3> A=$x </h3></center>";
   echo"<center><h3> B=$y </h3><center>";
   $z=$x+$y;
   echo "<center><h2> Ans=$z</h2></center>";
?>
</body>

</html>


Step:4 Save it on C drive=> wamp folder => www folder => name your folder

Step:5 To Run Open wampmanager= > local host



Step:6 Go to Your Project and Select your Folder Name and Click your example and see your output.


0
Step:1 Open Dreamweaver.

Step:2 Create PHP Page.




Step:3 Coding ..

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
/* Static Scope
When a function is completed, all of its variables are normally deleted. However, sometimes you want a local variable to not be deleted.

To do this, use the static keyword when you first declare the variable: */

<?php
function myTest()
{
    static $x=0;
    echo "<center>$x</center>";
    $x++;
}

myTest();
myTest();
myTest();

?>
</body>

</html>

Step:4 Save it on C drive=> wamp folder => www folder => name your folder

Step:5 To Run Open wampmanager= > local host


Step:6 Go to Your Project and Select your Folder Name and Click your example and see your output.


0
Step:1 Open Dreamweaver.

Step:2 Create PHP Page




Step:3 Coding ..

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>

/* Local Scope
A variable declared within a PHP function is local and can only be accessed within that function: */

<?php

$x=5;   //global scope

function myTest()
{
     echo $x;   //local scope
}

?>
</body>

</html>

Step:4 Save it on C drive=> wamp folder => www folder => name your folder

Step:5 To Run Open wampmanager= > local host


Step:6 Go to Your Project and Select your Folder Name and Click your example and see your output.




0
Step:1 Open Dreamweaver.

Step:2 Create PHP Page.




Step:3 Coding ..

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

/* Global Scope
A variable that is defined outside of any function, has a global scope.

Global variables can be accessed from any part of the script, EXCEPT from within a function.

To access a global variable from within a function, use the global keyword: */

<body>

<?php

$x=5; // global scope
$y=10; // global scope

function myTest()
{
      global $x,$y;
      $y=$x+$y;
}

myTest();
echo "<br><center><h2>$y</h2></center></br>"; // outputs 15

?>
</body>

</html>


Step:4 Save it on C drive=> wamp folder => www folder => name your folder.

Step:5 To Run Open wampmanager= > local host.



Step:6 Go to Your Project and Select your Folder Name and Click your example and see your output.



0
Step:1 Open Dreamweaver.

Step:2 Create PHP Page.




Step:3 Coding ..

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>ODD EVEN</title>
</head>
<?php

$i;
$odd=0;
$even=0;

echo '<center>'."ODD...........EVEN".'<br>';
for($i=1;$i<=100;$i++)
{
if($i%2==1)
{
$odd=$odd+$i;
}
else
{
$even=$even+$i;
}
}
echo "&nbsp;&nbsp;&nbsp;."."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.".'<br>';
echo "&nbsp;&nbsp;&nbsp;."."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.".'<br>';
echo "&nbsp;&nbsp;&nbsp;."."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.".'<br>';
echo "&nbsp;&nbsp;&nbsp;."."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.".'<br>';
echo "&nbsp;&nbsp;&nbsp;."."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.".'<br>';
echo "&nbsp;&nbsp;&nbsp;."."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.".'<br>';
echo "&nbsp;&nbsp;&nbsp;."."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.".'<br>';
echo "&nbsp;&nbsp;&nbsp;."."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.".'<br>';
echo "&nbsp;&nbsp;&nbsp;."."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.".'<br>';


echo $odd.'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
echo $even;


?>
<body>
</body>

</html>

Step:4 Save it on C drive=> wamp folder => www folder => name your folder

Step:5 To Run Open wampmanager= > local host


Step:6 Go to Your Project and Select your Folder Name and Click your example and see your output.



0
Previous Post Older Posts Home

Contact Us