Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
Maximum difference between two subsets of m elements in C
The task is to find the maximum difference between the sum of two subsets, each containing m elements from an array. We need to find the subset with the highest sum and the subset with the lowest sum, then calculate their difference. Syntax int find_diff(int arr[], int length, int m); Algorithm The approach to solve this problem is − Sort the array in ascending order Sum the first m elements (lowest subset) Sum the last m elements (highest subset) Return the difference between highest and lowest sums Example 1: Basic ...
Read MoreMaximum difference of sum of elements in two rows in a matrix in C
We are given a matrix and the task is to find the greatest difference between the sum of elements in two rows of a matrix. Suppose we have a matrix M[i,j] with i rows and j columns. Let the rows be R0 to Ri-1. The difference will be calculated by subtracting the (sum of elements of Ry) - (sum of elements of Rx), where x
Read MoreCreate a transition effect on hover pagination with CSS
To create a transition effect on hover pagination, use the CSS transition property. This property allows you to smoothly animate changes in CSS properties when a user hovers over pagination links, creating a professional and interactive user experience. Syntax selector { transition: property duration timing-function delay; } Example You can try to run the following code to add transition effect − .demo { ...
Read MoreCSS grid-template-columns property
The CSS grid-template-columns property is used to define the number and size of columns in a CSS Grid layout. This property allows you to specify how much space each column should take up and how the grid items should be distributed across the columns. Syntax selector { grid-template-columns: value1 value2 ... valueN; } Possible Values ValueDescription autoColumn size adjusts based on content lengthFixed size using px, em, rem, etc. %Percentage of container width frFraction of available space repeat()Repeats a pattern of column sizes Example 1: Auto-Sized Columns ...
Read MoreProgram for sum of geometric series in C
In C programming, calculating the sum of a geometric series involves finding the total of terms where each term is obtained by multiplying the previous term by a constant ratio. A geometric series follows the pattern: a, ar, ar2, ar3, ..., where 'a' is the first term, 'r' is the common ratio, and 'n' is the number of terms. Syntax float sumGeometric(float a, float r, int n); Parameters a − First term of the geometric series r − Common ratio between successive terms n − Number of terms in the series ...
Read MoreSet style for pagination with CSS
CSS pagination styling helps create user-friendly navigation for websites with multiple pages. You can style pagination links to provide clear visual feedback and improve user experience. Basic Syntax .pagination { display: inline-block; } .pagination a { float: left; padding: value; text-decoration: none; color: value; } Example: Basic Pagination Styling The following example demonstrates how to create styled pagination links − .pagination { ...
Read MoreProgram for triangular patterns of alphabets in C
In C programming, triangular patterns of alphabets are commonly used to demonstrate nested loops and character manipulation. This pattern starts with a full line of consecutive alphabets and removes one character from the beginning in each subsequent line. Syntax for (i = 1; i
Read MoreProfit and loss Problems using C
In C programming, profit and loss problems involve calculating the financial gain or loss from a transaction based on the cost price and selling price. Given a cost price (cp) and selling price (sp), we need to determine whether a profit was earned, a loss was suffered, or there was no profit nor loss. Syntax // Basic profit and loss calculation if (selling_price > cost_price) { profit = selling_price - cost_price; } else if (cost_price > selling_price) { loss = cost_price - selling_price; } else { ...
Read MoreUsage of CSS align-items property flex-start value
The CSS align-items property with the flex-start value aligns flex items to the start of the cross axis, which is typically the top of the container in a horizontal flex layout. Syntax .container { display: flex; align-items: flex-start; } Example You can try to run the following code to implement the flex-start value − .mycontainer { display: flex; height: 300px; ...
Read MoreRole of CSS justify-content property flex-end value
The CSS justify-content property with the flex-end value is used to align flex items at the end of the flex container's main axis. This moves all flex items to the right side of the container (in a row direction) or to the bottom (in a column direction). Syntax .container { display: flex; justify-content: flex-end; } Example You can try to run the following code to implement the flex-end value − ...
Read More