PHP | check if a number is Even or Odd
A number is called even if the number is divisible by 2 and is called odd if it is not divisible by 2. Given a number, we need to check whether it is odd or even in PHP....
read more
PHP | Check if a number is prime
Given a number, we need to check whether it is prime or not in PHP. General approach for prime check is discussed here. In this article we will learn about how to check if a number is prime or not in PHP....
read more
Javascript Program To Reverse Words In A Given String
Example: Let the input string be “i like this program very much”. The function should change the string to “much very program this like i”...
read more
PHP | Check if a number is Perfect number
A perfect number is a number if it is equal to the sum of its factors,that is original number is equal to sum of all its factors excluding the number itself. We have already discuss how to check if a number is perfect or not in this article. In this article we will discuss about how to do the same in PHP....
read more
Javascript Program to Efficiently compute sums of diagonals of a matrix
Given a 2D square matrix, find the sum of elements in Principal and Secondary diagonals. For example, consider the following 4 X 4 input matrix....
read more
Php Program to Efficiently compute sums of diagonals of a matrix
Given a 2D square matrix, find the sum of elements in Principal and Secondary diagonals. For example, consider the following 4 X 4 input matrix....
read more
Reverse words in a given string
Given a string, the task is to reverse the order of the words in the given string....
read more
Program for average of an array (Iterative and Recursive)
Given an array, the task is to find average of that array. Average is the sum of array elements divided by the number of elements....
read more
Count of nested polygons that can be drawn by joining vertices internally
Given a regular polygon with N sides. The task is to find the count of polygons that can be drawn from the given polygon by joining the vertices of the given polygon internally....
read more
C++ Program To Reverse Words In A Given String
Example: Let the input string be “i like this program very much”. The function should change the string to “much very program this like i”...
read more
Java Program To Reverse Words In A Given String
Example: Let the input string be “i like this program very much”. The function should change the string to “much very program this like i”...
read more
Pass Array to Functions in C
In C, the whole array cannot be passed as an argument to a function. However, you can pass a pointer to an array without an index by specifying the array’s name....
read more