diff --git a/source/_posts/Armstrong-Number-Program.md b/source/_posts/Armstrong-Number-Program.md
index b8cd51c9a829b91a04180936b34766cc7d87b199..526ff57a51fc5578e3d06c482a6ac7ef1f60acf4 100644
--- a/source/_posts/Armstrong-Number-Program.md
+++ b/source/_posts/Armstrong-Number-Program.md
@@ -1,6 +1,6 @@
---
title: Armstrong Number Program
-date: 2016-10-11 16:56:37
+date: 2012-01-27 08:03:45
categories:
- Codes
tags:
diff --git a/source/_posts/Calculate-Celsius-to-Fahrenheit-Temperature-in-Java.md b/source/_posts/Calculate-Celsius-to-Fahrenheit-Temperature-in-Java.md
new file mode 100644
index 0000000000000000000000000000000000000000..949af8980fcc00b498f989ca076107bb9f8d2e57
--- /dev/null
+++ b/source/_posts/Calculate-Celsius-to-Fahrenheit-Temperature-in-Java.md
@@ -0,0 +1,84 @@
+---
+title: Calculate Celsius to Fahrenheit Temperature in Java
+date: 2012-06-16 15:31:13
+categories:
+ - Codes
+tags:
+ - code-example
+ - java
+ - swing
+---
+In-order to convert from Celsius to Fahrenheit, we have to apply a simple logic onto Celsius "Multiply by 9, then divide by 5, then add 32".
+
+Our code provides a simple GUI, where the user has to enter the temperature in Celsius and after clicking on convert displays the Fahrenheit temperature below button in the form of JLabel.
+
+The Class has been designed by extending JPanel which can be called from other classes and added onto the JFrame for displaying.
+
+#### Screenshot
+
+
+
+#### C2F.java
+
+```java
+package com.rohansakhale.treedemo;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import javax.swing.BoxLayout;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+/**
+ *
+ * @author RohanSakhale
+ */
+public class C2F extends JPanel {
+
+ JTextField tfInputTemp;
+ JLabel lInputTemp, lAnswer;
+ JButton bCalc;
+ JPanel InputTemp, collections;
+
+ public C2F() {
+ tfInputTemp = new JTextField(15);
+ lInputTemp = new JLabel("Enter Temperature in Celsius: ");
+ lAnswer = new JLabel("Answer: ");
+ bCalc = new JButton("Convert");
+ InputTemp = new JPanel();
+ collections = new JPanel();
+ collections.setLayout(new BoxLayout(collections, BoxLayout.Y_AXIS));
+ InputTemp.add(lInputTemp);
+ InputTemp.add(tfInputTemp);
+ collections.add(InputTemp);
+ collections.add(bCalc);
+ collections.add(lAnswer);
+ bCalc.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (!tfInputTemp.getText().equals("")) {
+ double temp = Double.parseDouble(tfInputTemp.getText());
+ double fahrenheit = ((temp * 9) / 5) + 32;
+ lAnswer.setText("Answer: " + fahrenheit + " F");
+ }
+ }
+ });
+ add(collections);
+ }
+}
+
+class C2FMainDemo{
+ public static void main(String[] args) {
+ JFrame c2fFrame = new JFrame("Celsius to Fahrenheit Demo Program");
+ C2F c2f = new C2F();
+ c2fFrame.add(c2f);
+ c2fFrame.setSize(400, 150);
+ c2fFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ c2fFrame.setVisible(true);
+ }
+}
+```
\ No newline at end of file
diff --git a/source/_posts/Calculate-Fahrenheit-to-Celsius-Temperature-in-Java.md b/source/_posts/Calculate-Fahrenheit-to-Celsius-Temperature-in-Java.md
new file mode 100644
index 0000000000000000000000000000000000000000..5d219c735ab4bad42f9218559ea496d1c31450ad
--- /dev/null
+++ b/source/_posts/Calculate-Fahrenheit-to-Celsius-Temperature-in-Java.md
@@ -0,0 +1,83 @@
+---
+title: Calculate Fahrenheit to Celsius Temperature in Java
+date: 2012-06-16 15:31:03
+categories:
+ - Codes
+tags:
+ - code-example
+ - java
+ - swing
+---
+In-order to convert from Fahrenheit to Celsius, we have to apply a simple logic onto Celsius "Deduct 32, then multiply by 5, then divide by 9".
+
+Our code provides a simple GUI, where the user has to enter the temperature in Fahrenheit and after clicking on convert displays the Celsius temperature below button in the form of JLabel.
+
+The Class has been designed by extending JPanel which can be called from other classes and added onto the JFrame for displaying.
+
+#### Screenshot:
+
+
+
+#### F2C.java
+
+```java
+package com.rohansakhale.treedemo;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import javax.swing.BoxLayout;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+/**
+ *
+ * @author RohanSakhale
+ */
+public class F2C extends JPanel{
+ JTextField tfInputTemp;
+ JLabel lInputTemp, lAnswer;
+ JButton bCalc;
+ JPanel InputTemp, collections;
+
+ public F2C() {
+ tfInputTemp = new JTextField(15);
+ lInputTemp = new JLabel(\"Enter Temperature in Fahrenheit: \");
+ lAnswer = new JLabel(\"Answer: \");
+ bCalc = new JButton(\"Convert\");
+ InputTemp = new JPanel();
+ collections = new JPanel();
+ collections.setLayout(new BoxLayout(collections, BoxLayout.Y_AXIS));
+ InputTemp.add(lInputTemp);
+ InputTemp.add(tfInputTemp);
+ collections.add(InputTemp);
+ collections.add(bCalc);
+ collections.add(lAnswer);
+ bCalc.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (!tfInputTemp.getText().equals(\"\")) {
+ double temp = Double.parseDouble(tfInputTemp.getText());
+ double celsius = (temp - 32 ) * 5 / 9;
+ lAnswer.setText(\"Answer: \" + celsius + \" C\");
+ }
+ }
+ });
+ add(collections);
+ }
+}
+
+class F2CMainDemo{
+ public static void main(String[] args) {
+ JFrame f2cFrame = new JFrame(\"Celsius to Fahrenheit Demo Program\");
+ F2C f2c = new F2C();
+ f2cFrame.add(f2c);
+ f2cFrame.setSize(400, 150);
+ f2cFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ f2cFrame.setVisible(true);
+ }
+}
+```
\ No newline at end of file
diff --git a/source/_posts/Concurrent-Chat-Application-in-Java.md b/source/_posts/Concurrent-Chat-Application-in-Java.md
index ec54c4e1469ec68debc3eecb7d636b877e953ffe..e15e26f26d0df66acdc67b3c6a00e9504844bbd3 100644
--- a/source/_posts/Concurrent-Chat-Application-in-Java.md
+++ b/source/_posts/Concurrent-Chat-Application-in-Java.md
@@ -1,6 +1,6 @@
---
title: Concurrent Chat Application in Java
-date: 2016-10-11 20:57:45
+date: 2012-06-16 15:50:12
categories:
- Codes
tags:
diff --git a/source/_posts/Convert-Integer-to-Binary.md b/source/_posts/Convert-Integer-to-Binary.md
index 49222d8cd6b8842747e7d28af27d3d3944d95bf8..fa95a4d8b533a89b6538acd81b3a530ecb60c09c 100644
--- a/source/_posts/Convert-Integer-to-Binary.md
+++ b/source/_posts/Convert-Integer-to-Binary.md
@@ -1,6 +1,6 @@
---
title: Convert Integer to Binary
-date: 2016-10-11 17:22:49
+date: 2012-02-12 23:56:09
categories:
- Codes
tags:
diff --git a/source/_posts/Create-Web-Service-using-PHP-JSON.md b/source/_posts/Create-Web-Service-using-PHP-JSON.md
index c867afe8df886ca2b6efc053092a67e6eabc8019..16ec63baa3bfac9edd9167d82343e32fb45bd285 100644
--- a/source/_posts/Create-Web-Service-using-PHP-JSON.md
+++ b/source/_posts/Create-Web-Service-using-PHP-JSON.md
@@ -1,6 +1,6 @@
---
title: Create Web Service using PHP & JSON
-date: 2016-10-11 18:09:47
+date: 2012-05-24 16:36:40
categories:
- Codes
tags:
diff --git a/source/_posts/Draw-Line-using-Bresenham-s-Algorithm.md b/source/_posts/Draw-Line-using-Bresenham-s-Algorithm.md
index fcc757d64f64aceb7700cef33e621c04b69ee7e7..6350ecb869463f8fd0b8aac4bfc3ac66a23d4b1a 100644
--- a/source/_posts/Draw-Line-using-Bresenham-s-Algorithm.md
+++ b/source/_posts/Draw-Line-using-Bresenham-s-Algorithm.md
@@ -1,6 +1,6 @@
---
title: Draw Line using Bresenham's Algorithm
-date: 2016-10-11 16:55:06
+date: 2011-11-12 12:25:40
categories:
- Codes
tags:
diff --git a/source/_posts/Draw-Line-using-DDA-Algorithm.md b/source/_posts/Draw-Line-using-DDA-Algorithm.md
index 2ea870b4b05348f3b156e5c9d248c2da6999c9fb..fde43f6e1b568200405bcf8cbd8cbad470626f22 100644
--- a/source/_posts/Draw-Line-using-DDA-Algorithm.md
+++ b/source/_posts/Draw-Line-using-DDA-Algorithm.md
@@ -1,6 +1,6 @@
---
title: Draw Line using DDA Algorithm
-date: 2016-10-11 16:53:37
+date: 2011-11-12 12:11:39
categories:
- Codes
tags:
diff --git a/source/_posts/Factorial-Number-Program-in-PHP.md b/source/_posts/Factorial-Number-Program-in-PHP.md
index a85fb60b04f398f63fc8e3b9b15199af16de458f..70209d77e02966bf6b8d0e805eb99ff2cf18670e 100644
--- a/source/_posts/Factorial-Number-Program-in-PHP.md
+++ b/source/_posts/Factorial-Number-Program-in-PHP.md
@@ -1,6 +1,6 @@
---
title: Factorial Number Program in PHP
-date: 2016-10-11 17:45:01
+date: 2012-06-06 00:02:03
categories:
- Codes
tags:
diff --git a/source/_posts/Factorial-Program-in-Java.md b/source/_posts/Factorial-Program-in-Java.md
new file mode 100644
index 0000000000000000000000000000000000000000..796fd3aaea4d7186dd33af30961add13c452e0a4
--- /dev/null
+++ b/source/_posts/Factorial-Program-in-Java.md
@@ -0,0 +1,103 @@
+---
+title: Factorial Program in Java
+date: 2012-06-16 15:31:33
+categories:
+ - Codes
+tags:
+ - code-example
+ - java
+---
+In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. For example,
+
+```
+5! = 5 x 4 x 3 x 2 x 1 = 120
+```
+
+The following code creates a GUI for calculating factorial numbers upto 170.
+
+The user has to enter the number and click on Calculate which displays the answer on JLabel below the button.
+
+The Class has been designed by extending JPanel which can be called from other classes and added onto the JFrame for displaying.
+
+#### Screenshot
+
+
+
+#### Factorial.java
+
+```java
+package com.rohansakhale.fact;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import javax.swing.BoxLayout;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+/**
+ *
+ * @author RohanSakhale
+ */
+public class Factorial extends JPanel {
+
+ JTextField tfNumber;
+ JLabel lEnterNumber, lAnswer;
+ JButton bCalc;
+ JPanel number, collection;
+
+ public Factorial() {
+ tfNumber = new JTextField(15);
+ lEnterNumber = new JLabel("Enter Number: ");
+ lAnswer = new JLabel("Answer: ");
+ bCalc = new JButton("Calculate");
+ number = new JPanel();
+ collection = new JPanel();
+ collection.setLayout(new BoxLayout(collection, BoxLayout.Y_AXIS));
+ number.add(lEnterNumber);
+ number.add(tfNumber);
+ collection.add(number);
+ collection.add(bCalc);
+ collection.add(lAnswer);
+
+ bCalc.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (!tfNumber.getText().equals(")) {
+ double num = Integer.parseInt(tfNumber.getText());
+ if(num <= 170){
+ double fact = 1;
+ for(double i = 1;i<=num;i++){
+ fact = fact * i;
+ }
+ lAnswer.setText("Answer: " + fact);
+ tfNumber.setText(");
+ tfNumber.requestFocus();
+ }else{
+ JOptionPane.showMessageDialog(null, "Please enter number upto 170", "Error", JOptionPane.ERROR_MESSAGE);
+ }
+ }else{
+ JOptionPane.showMessageDialog(null, "Please enter number upto 170", "Error", JOptionPane.ERROR_MESSAGE);
+ }
+ }
+ });
+ add(collection);
+ }
+}
+
+class FactorialDemo{
+ public static void main(String[] args) {
+ JFrame factFrame = new JFrame("Factorial Demo Program");
+ Factorial fact = new Factorial();
+ factFrame.add(fact);
+ factFrame.setSize(400,150);
+ factFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ factFrame.setVisible(true);
+ }
+}
+
+```
\ No newline at end of file
diff --git a/source/_posts/File-IO-Operation-in-Java.md b/source/_posts/File-IO-Operation-in-Java.md
index 5326e9c1e019eb10d1eab49540a1da6db9e6ae53..5507f1e88c268d3214993273ad6fc0cae125cfbf 100644
--- a/source/_posts/File-IO-Operation-in-Java.md
+++ b/source/_posts/File-IO-Operation-in-Java.md
@@ -1,6 +1,6 @@
---
title: File IO Operation in Java
-date: 2016-10-11 17:37:31
+date: 2012-06-27 14:25:44
categories:
- Codes
tags:
diff --git a/source/_posts/Funny-Program.md b/source/_posts/Funny-Program.md
index 77655c97cb2435c633a89c08b4175671ebf3a25c..864a25f159f9d3580ed53ce7729b90408ee7b979 100644
--- a/source/_posts/Funny-Program.md
+++ b/source/_posts/Funny-Program.md
@@ -1,6 +1,6 @@
---
title: Funny Program
-date: 2016-10-11 17:11:08
+date: 2012-01-27 08:03:25
categories:
- Codes
tags:
diff --git a/source/_posts/JList-Java-Swing-Component-Demo.md b/source/_posts/JList-Java-Swing-Component-Demo.md
index ed3bd0b04b20d82f676c1cc461123886adabf87b..bed21189702529e5fc9a69d489f649f1b0b4bc57 100644
--- a/source/_posts/JList-Java-Swing-Component-Demo.md
+++ b/source/_posts/JList-Java-Swing-Component-Demo.md
@@ -1,6 +1,6 @@
---
title: JList Java Swing Component Demo
-date: 2016-10-11 16:51:53
+date: 2011-11-12 08:14:02
categories:
- Codes
tags:
diff --git a/source/_posts/JTree-Java-Swing-Component-Demo.md b/source/_posts/JTree-Java-Swing-Component-Demo.md
index af6cc29f2b086b0be9e8813b79e0a3d7e6a04809..5fd17cc0e52b402620c10f913529eb29406aeeb1 100644
--- a/source/_posts/JTree-Java-Swing-Component-Demo.md
+++ b/source/_posts/JTree-Java-Swing-Component-Demo.md
@@ -1,6 +1,6 @@
---
title: JTree Java Swing Component Demo
-date: 2016-10-11 16:52:51
+date: 2011-11-12 10:33:50
categories:
- Codes
tags:
diff --git a/source/_posts/JTree-Simple-Practice-Application-in-Java.md b/source/_posts/JTree-Simple-Practice-Application-in-Java.md
new file mode 100644
index 0000000000000000000000000000000000000000..30bb2c1f162a97b56d0afffd897befefc32f7af5
--- /dev/null
+++ b/source/_posts/JTree-Simple-Practice-Application-in-Java.md
@@ -0,0 +1,136 @@
+---
+title: JTree Simple Practice Application in Java
+date: 2012-06-16 15:24:18
+categories:
+ - Codes
+tags:
+ - code-example
+ - java
+ - swing
+---
+JTree is a control that displays a set of hierarchical data as an outline.
+
+We will use it as a menu to navigate through various small applications we made previously.
+
+The tree will basically contain each program as a node when selected using mouse, that particular program is displayed onto the JFrame.
+
+Programs used in this code are already being posted before for practice, I will name the Class & the link to find the class
+
+1. [Simple Calculator in Java]()
+1. [Factorial Program in Java]()
+1. [Calculate Celsius to Fahrenheit Temperature in Java]()
+1. [Calculate Fahrenheit to Celsius Temperature in Java]()
+
+#### Screenshot
+
+
+
+
+
+
+
+
+
+
+
+#### TreeDemo.java
+
+```java
+package com.rohansakhale.treedemo;
+
+import java.awt.BorderLayout;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import javax.swing.JFrame;
+import javax.swing.JTree;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.TreePath;
+
+/**
+ *
+ * @author RohanSakhale
+ */
+public class TreeDemo {
+
+ static String lastComponent = \"\";
+
+ public static void main(String[] args) {
+ final JFrame jf = new JFrame(\"Practice Applications\");
+
+ DefaultMutableTreeNode pracApps = new DefaultMutableTreeNode(\"Practice Apps\", true);
+ DefaultMutableTreeNode calc = new DefaultMutableTreeNode(\"Calculator\");
+ DefaultMutableTreeNode fact = new DefaultMutableTreeNode(\"Factorial\");
+ DefaultMutableTreeNode temperature = new DefaultMutableTreeNode(\"Temperature\", true);
+ DefaultMutableTreeNode c2f = new DefaultMutableTreeNode(\"C to F\");
+ DefaultMutableTreeNode f2c = new DefaultMutableTreeNode(\"F to C\");
+ temperature.add(c2f);
+ temperature.add(f2c);
+ pracApps.add(calc);
+ pracApps.add(fact);
+ pracApps.add(temperature);
+ final JTree tree = new JTree(pracApps);
+
+ // JTree here can act as a menu for Practice Applications
+ // We add it on the west side of the JFrame
+
+ jf.add(BorderLayout.WEST, tree);
+
+ /*
+ * Classes created here within the same package can also be found online
+ * Calc = http://rohansakhale.com/codes/39/simple-calculator-in-java
+ * Factorial = http://rohansakhale.com/codes/40/factorial-program-in-java
+ * C2F = http://rohansakhale.com/codes/41/calculate-celsius-to-fahrenheit-temperature-in-java
+ * F2C = http://rohansakhale.com/codes/42/calculate-fahrenheit-to-celsius-temperature-in-java
+ *
+ */
+ final Calc calculatorPanel = new Calc();
+ final Factorial factorialPanel = new Factorial();
+ final C2F c2fObj = new C2F();
+ final F2C f2cObj = new F2C();
+
+ // Lets change the panel on center of JFrame
+ // by checking the mouse click
+ tree.addMouseListener(new MouseAdapter() {
+
+ @Override
+ public void mouseClicked(MouseEvent me) {
+ TreePath path = tree.getPathForLocation(me.getX(), me.getY());
+ if (path != null) {
+ // Check the last added component and remove it
+ if (!lastComponent.equals(\"\")) {
+ if (lastComponent.equals(\"Factorial\")) {
+ jf.remove(factorialPanel);
+ } else if (lastComponent.equals(\"C to F\")) {
+ jf.remove(c2fObj);
+ } else if (lastComponent.equals(\"Calculator\")) {
+ jf.remove(calculatorPanel);
+ } else if (lastComponent.equals(\"F to C\")) {
+ jf.remove(f2cObj);
+ }
+ }
+
+ // Add the new component on the frame
+ // Depending on the Selected Tree Node
+ if (path.toString().contains(\"Calculator\")) {
+ jf.add(calculatorPanel);
+ lastComponent = \"Calculator\";
+ } else if (path.toString().contains(\"Factorial\")) {
+ jf.add(factorialPanel);
+ lastComponent = \"Factorial\";
+ } else if (path.toString().contains(\"C to F\")) {
+ jf.add(c2fObj);
+ lastComponent = \"C to F\";
+ } else if (path.toString().contains(\"F to C\")) {
+ jf.add(f2cObj);
+ lastComponent = \"F to C\";
+ }
+ jf.repaint();
+ }
+ }
+ });
+ jf.setSize(600, 400);
+ jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ jf.setVisible(true);
+ }
+}
+```
\ No newline at end of file
diff --git a/source/_posts/Java-Socket-Program-to-check-Prime-Number.md b/source/_posts/Java-Socket-Program-to-check-Prime-Number.md
index a9db90b74cb7aff6574776d0fb6e407f3d7f3416..d294143deeff35c1754caa5309c4d6e82b9e9da7 100644
--- a/source/_posts/Java-Socket-Program-to-check-Prime-Number.md
+++ b/source/_posts/Java-Socket-Program-to-check-Prime-Number.md
@@ -1,6 +1,6 @@
---
title: Java Socket Program to check Prime Number
-date: 2016-10-11 17:25:39
+date: 2012-02-13 15:14:51
categories:
- Codes
tags:
diff --git a/source/_posts/Login-Validation-Program.md b/source/_posts/Login-Validation-Program.md
index 6a961cdfe506b8e0e157723d418cfbf4e409394f..57d445e44a4edc563878b3449543c8b9efc79e76 100644
--- a/source/_posts/Login-Validation-Program.md
+++ b/source/_posts/Login-Validation-Program.md
@@ -1,6 +1,6 @@
---
title: Login Validation Program
-date: 2016-10-11 16:50:10
+date: 2011-11-12 07:59:07
categories:
- Codes
tags:
diff --git a/source/_posts/Midpoint-Circle-Algorithm.md b/source/_posts/Midpoint-Circle-Algorithm.md
index 267f609bcd60b31b95743b540d427e5b2d73c14e..ac652aab6824689fcb5d03b5f3a66561329d8a2c 100644
--- a/source/_posts/Midpoint-Circle-Algorithm.md
+++ b/source/_posts/Midpoint-Circle-Algorithm.md
@@ -1,6 +1,6 @@
---
title: Midpoint Circle Algorithm
-date: 2016-10-11 16:55:59
+date: 2011-11-14 18:58:45
categories:
- Codes
tags:
diff --git a/source/_posts/PHP-Factorial-program-using-GMP-Functions.md b/source/_posts/PHP-Factorial-program-using-GMP-Functions.md
new file mode 100644
index 0000000000000000000000000000000000000000..144237873c834c0f521af8d37a3719c7eadec1c8
--- /dev/null
+++ b/source/_posts/PHP-Factorial-program-using-GMP-Functions.md
@@ -0,0 +1,40 @@
+---
+title: PHP Factorial program using GMP Functions
+date: 2012-06-04 17:13:14
+categories:
+ - Codes
+tags:
+ - code-example
+ - php
+---
+Regular working with arbitrary number is usually a tough job, normally for generating factorial number using the regular looping methods you can generate only upto 170, and it doesn't work for huge numbers.
+
+**GMP** is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers.
+
+GMP functions allow you to work with arbitrary-length integers using the GNU MP library.
+
+You may need to do the initializations of GMP onto the server side if it don't work directly, read on php.net for it.
+
+For complete reference on GMP functions [visit here](http://www.php.net/manual/en/ref.gmp.php).
+
+The following code accepts a number from user and on the server side it is checked if numeric and passed onto the `gmp_fact()` method which returns the factorial of it and output is displayed on the screen.
+
+#### gmp_try.php
+
+```php
+\';
+ } else {
+ echo \'Enter proper number
\';
+ }
+}
+?>
+
See the Pen MVC Datastructure JavaScript by Rohan Sakhale (@rsakhale) on CodePen.
+ + +#### Screenshots + + + + + + +#### Code + +```html + + + + +