How check whether a number is prime or not in java.
Given an input integer, write a code to check whether an input number is prime or not.
For example –
Example 1:
Input: 7
output: true
Example 2:
Input: 12
Output: false
Write a PHP script to swap two numbers. In this tutorial, we are going to write a code to swap two numbers in PHP.
There are multiple approaches by which you can swap two numbers.
i) We can swap two numbers using third or temp variable.
ii) We can swap two numbers without using third variable.