Skip to content

Category Archives: PHP Programs

We will upload multiple records to the database and display all the records from the database on the same page.  In this article, we will… Read More
Given a matrix and the task is to check matrix is involutory matrix or not. Involutory Matrix: A matrix is said to be involutory matrix if… Read More
Given an array of n elements. Our task is to write a program to rearrange the array such that elements at even positions are greater… Read More
Given two strings s1 and s2, find if s1 is a substring of s2. If yes, return the index of the first occurrence, else return… Read More
Introduction to Identity Matrix :  The dictionary definition of an Identity Matrix is a square matrix in which all the elements of the principal or… Read More
Given an array a, we have to find the minimum product possible with the subset of elements present in the array. The minimum product can… Read More
Given two sorted arrays of distinct elements, we need to print those elements from both arrays that are not common. The output should be printed… Read More
Given a sorted array of distinct positive integers, print all triplets that form AP (or Arithmetic Progression)Examples :   Input : arr[] = { 2, 6,… Read More
Given a range [L, R], we need to find the count of total numbers of prime numbers in the range [L, R] where 0 Output:  … Read More
Given a n x n matrix. The problem is to sort the matrix row-wise and column wise.Examples:   Input : mat[][] = { {4, 1, 3},… Read More
Given a n × m binary matrix, count the number of sets where a set can be formed one or more same values in a… Read More
Given a 4 x 4 matrix, we have to interchange the elements of first and last row and show the resulting matrix.Examples :   Input :… Read More
An array is given, find length of the subarray having maximum sum. Examples :  Input : a[] = {1, -2, 1, 1, -2, 1} Output… Read More
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
Given a matrix, the task is to find the maximum element of each row.Examples:   Input : [1, 2, 3] [1, 4, 9] [76, 34, 21]… Read More