Numbers in Php

This is basic and fundamental PHP Tutorial in which beginners learn how we can declare and initialize number in PHP. In our example we just initialize two numbers and then find the sum of both two numbers and display.

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 "<br />";
    echo "<br />";
  ?>
  </body>

</html>

OUTPUT OF THE PROGRAM


Numbers
Numbers 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