Write a program to add two number in php

This tutorial uses old techniques. It is insecure and will leave your server vulnerable to SQL Injection attacks. This post will be delete or revised in the future. In the tutorial I will show you how to write data to the database directly through a from on your website.

Write a program to add two number in php

Both ceil and floor take just one parameter - the number to round. Ceil takes the number and rounds it to the nearest integer above its current value, whereas floor rounds it to the nearest integer below its current value. Here is an example: The floor function converts a floating-point number to an integer in roughly the same way as typecasting, except typecasting is faster.

The only difference is with negative numbers, where floor will round The other function available is roundwhich takes two parameters - the number to round, and the number of decimal places to round to.

Creating PHP Function

If a number is exactly half way between two integers, round will always round up. Line four has parameter two being used for the first time, which shows that it is very easy to round to a given number of decimal places. Note that in line five we get 4.

That is, if our number were 4. Imagine you were organising a big trip to the countryside, and people signed up. You need to figure out how many coaches you need to hire, so you take the number of people,and divide it by the capacity of your coaches,then round it to get a whole number, and you find the result is 6.

Java Program to Add two Numbers

Where is the problem? As you cannot order six and a half coaches, what do you do? The solution is simple: All three rounding functions are useful in their own right, so be sure to try to remember them all. Want to learn PHP 7? Get over pages of hands-on PHP learning today! If this was helpful, please take a moment to tell others about Hacking with PHP by tweeting about it!how to create this program “You are required to write a program that finds the number (in the given range) which has maximum number of divisors.

write a program to add two number in php

The program first asks the user to input two values P and Q for a range (where p. C Program to Make a Simple Calculator Using switch case. Example to create a simple calculator to add, subtract, multiply and divide using switch and break statement. Add Two Integers. Swap Two Numbers. Multiply two Floating Point Numbers.

C# Parameter Programming Example

Print an Integer (Entered by the User) Check Prime or Armstrong Number Using User-defined . Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site.

Ask the user to input a vector of any number of elements then write a code that will add each element in the vector to its index (location). For example, if the vector is [9 -4 6 7], it becomes [10 Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site.

rutadeltambor.com a shell script to perform integer arithmetic operations. AIM: Write shell script that will add two nos, which are supplied as command number is found at 3 position Write a shell script to accept a string in the command line and reverse the same string.

write a function to add numbers to a sum?