Numbers Increment and Decrements in PHP

This is the basic PHP tutorial about number increment and decrement in PHP. 

Source Code 


<html>
 <title> PHP Number Demo </title>
  <body>
  <?php 
    echo "<br />";
       echo "<br />";
    $num_1 = 786;
    $num_2 = 786;
    echo "Number _ 1 : ";
    echo $num_1;
    echo "<br />";
    echo "Number _ 2 : ";
    echo $num_2;
    echo "<br />";
  ?>
  
  <?php
   echo "<br />";
   echo "<br />";
  ?>
  <?php 
    $num_3 = 0;
    $num_3 = $num_1 + $num_2;
    echo "Sum  : ";
    echo $num_3;
    echo "<br />";
    echo "<br />";
  ?>
  <?php
    echo "First Increment Number 1 :   : ";
    $num_1++;
    echo $num_1;
    echo "<br />";
    echo "First Increment Number 1 :   : ";
    $num_1++;
    echo $num_1;
    echo "<br />";
    echo "First Increment Number 1 :   : ";
    $num_1++;
    echo $num_1;
    echo "<br />";
    echo "<br />";
  ?>
  <?php
    echo "<br />";
    echo "First Decrement Number 1 :   : ";
    $num_1--;
    echo $num_1;
    echo "<br />";
    echo "First Decrement Number 1 :   : ";
    $num_1--;
    echo $num_1;
    echo "<br />";
    echo "First Decrement Number 1 :   : ";
    $num_1--;
    echo $num_1;
  ?>
  </body>

</html>

Output of the Program 

Numbers in hp
Number in Php

Share on Google Plus

About Asad

Asad Niazi is Software Engineer , Programmer, Web Developer and a young mentor of BloggersTown and PProgramming. Asad Love to writes about Technology, Programming, Blogging and make money online.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment