Elements present in first array and not in second using STL in C++ Given two arrays, the task is that we find numbers which are present in first array, but not present in the second array, using STL in C++ Examples: Input: a[] = {1, 2, 3, 4, 5, 10}, b[] = {2, 3, 1, 0, 5} Output: 4 10 Input:a[] = {4, 3, 5, 9, 11}, b[] = {4, 9, 3, 11, 10}; Output: 5 Approach: In STL,
2 min read
C++ Program to Interchange Diagonals of Matrix Given a square matrix of order n*n, you have to interchange the elements of both diagonals. Examples : Input : matrix[][] = {1, 2, 3, 4, 5, 6, 7, 8, 9} Output : matrix[][] = {3, 2, 1, 4, 5, 6, 9, 8, 7} Input : matrix[][] = {4, 2, 3, 1, 5, 7, 6, 8, 9, 11, 10, 12, 16, 14, 15, 13} Output : matrix[][] =
2 min read