Thursday, 17 March 2016

PHP Inheritance

class test
{
function test_base()
{
echo "<br>Base class function";
}

}

class client extends test
{
function client_function()
{
echo "<br>Inside of client function ";
}
}

PHP Class Object Tutorial

class test
{
function test_class()
{
echo "<h1>by default function is public visibility </h1>";
}
function add_num($n1,$n2)
{
return $n1+$n2;
}
private function test_private()
{
echo "<h2> For making private function private keyword is used </h2>";
}
function access_private()
{
$this->test_private();
}
}

Wednesday, 16 March 2016

Difference between Top-Down and Bottom- Up Programming

Top Down Programming

Top down approach is used by procedure oriented language like C. In this concern A problem is solved by the top level wise i.e. A main function is created which draw a sketch that how will our program be started and then find out the low level modules further. The problem is divided into the sub modules and implemented each coding separately, which called and control by the main function. Top down approach is no longer popular today.

Bottom Up Programming


Bottom up approach is used by the object oriented language like C++, Java, C#, VB.Net, etc. In this approach design starts with bottom level , by inside of a class. Ones A class is implemented, then object of that class is created. A main function is generally also used here like procedure oriented  languages as a starting point, but it’s used only to call the class functions.

Tuesday, 15 March 2016

Calculate Totient number from given number



Q : Write a program to get Totient number from given number?


[     Totient number = All prime number(M)<given prime number(N)
      l.e. N=10
     M={1,3,5,7}=4
]

Answer : 


/*   ::: Girfa :::
http://girfahelp.blogspot.in/p/c-language.html
program : get all prime number less than given number   */