Write a C program to determine whether the given matrix is a lower triangular matrix or not. We call a square matrix a lower triangular matrix when all the elements above its main diagonal are zero whereas the ones below and on the diagonal are non-zero. For this, we require the size of the square matrix and the elements of ...
Read More »C Programs
C Program : To Reverse the Elements of An Array | C Programs
C program to display the given array in reverse order. To do so, we will require the number of elements or size of the array and the elements or data values of the array as inputs. Our expected output as clearly mentioned in the problem statement is, the array being displayed in the reverse order. C Program to Reverse an ...
Read More »C Program Merge Two Sorted Arrays – 3 Ways | C Programs
The problem statement here is, to write a C program to merge two sorted array in sorted order. To implement this, we’ll require the number of elements or sizes of the the two arrays along with the array elements in sorted order as our input. The desired output in the end is a single array which is the combination of ...
Read More »C Program : Convert An Array Into a Zig-Zag Fashion
The given problem statement is, to write a C program to convert the array into zig-zag fashion i.e., converting it in the form where a<b>c<d>e<f. The input requirement for this is the number of elements (or size) in the array along with the data values or elements of the array. Our desired resultant output is an array converted into zig-zag ...
Read More »C Program : Minimum Scalar Product of Two Vectors | C Programs
C program to find the minimum scalar product (dot product) of given two vectors. A scalar product or dot product is the product of the given two equal length vectors. To find the scalar product, we require the number of elements or sizes of the two arrays representing the vectors and the data values of the arrays (or vectors). The ...
Read More »C Program Transpose of a Matrix 2 Ways | C Programs
C program to find the transpose of a given matrix. Transpose of a matrix is nothing but flipping the matrix via its diagonal such that, the rows and columns of the matrix are switched i.e., a[i][j] becomes a[j][i] and vice versa. To implement this, we require an input matrix (2D array) whose transpose matrix is to be found along with ...
Read More »C Program : Maximum Scalar Product of Two Vectors
Write a C program to find the maximum scalar product of the given two vectors. For this, we will represent vectors in the form of arrays and the inputs necessary are size of the two arrays and the data values or elements of the two arrays. The resultant output is an integer representing the largest or maximum possible scalar product ...
Read More »C program : Find Median of Two Sorted Arrays | C Programs
Write a C program to find the median of the given two sorted arrays. Median is the middle number when the numbers are sorted in either ascending or descending order. To implement this, our required inputs are the sizes of two arrays along with the elements or data values of the two arrays. Our desired output is the double type ...
Read More »C Program : Check If Arrays are Disjoint or Not | C Programs
Write a C program to find whether the given two arrays are disjoint set or not. We call two arrays disjoint set when they have no common elements between them. For checking this, we’ll first require the number of elements in the two arrays and the data values or elements in the two arrays as input. Our expected output as ...
Read More »C Program : Find Missing Elements of a Range – 2 Ways | C Programs
Write a C program to find the missing elements of a given range. For this, the set of inputs necessary are, size of an array or number of elements in the array along with the elements or data values of the array. We also need the start and end range as input based on which we’ll compare with the array ...
Read More »