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
C program to interchange the diagonal elements in given matrix
In C programming, interchanging the diagonal elements of a matrix involves swapping the main diagonal elements with the secondary (anti) diagonal elements. This operation is only possible with square matrices where the number of rows equals the number of columns. Syntax /* Logic to interchange diagonal elements */ for (i = 0; i < n; i++) { temp = matrix[i][i]; /* Store main diagonal element */ matrix[i][i] = matrix[i][n-i-1]; /* Assign ...
Read MoreHow to create a Hoverable Sidenav with CSS?
A hoverable sidenav is a navigation menu that slides out from the side of the page when hovered. This creates an interactive navigation experience while saving screen space. Syntax selector { position: fixed; left: -width; transition: duration; } selector:hover { left: 0; } Example The following example creates a hoverable side navigation with multiple links that slide out on hover − Hoverable Sidenav nav a ...
Read MoreRetained Earnings
Retained earnings represent the portion of a company's net income that is not distributed to shareholders as dividends but is instead reinvested in the business. These accumulated profits serve as an internal source of financing for growth opportunities, debt repayment, and working capital needs. Formula The retained earnings formula shows how these funds accumulate over time: $$\mathrm{Retained\ Earnings_{Ending} = Retained\ Earnings_{Beginning} + Net\ Income - Dividends\ Paid}$$ Where: Retained Earnings (Ending) − Current period's retained earnings balance Retained Earnings (Beginning) − Previous period's retained earnings balance Net Income − Company's profit after taxes for the ...
Read MoreHow to create a responsive side navigation menu with CSS?
A responsive side navigation menu adapts its layout based on screen size. On larger screens, it appears as a fixed sidebar, while on smaller screens it transforms into a horizontal navigation bar. Syntax /* Fixed sidebar for desktop */ nav { position: fixed; width: fixed-width; height: 100%; } /* Responsive behavior */ @media screen and (max-width: breakpoint) { nav { position: relative; width: 100%; ...
Read MoreC program to perform operations on two halves' in a single array
In C programming, we can perform different operations on two halves of a single array. This approach is useful when you need to apply distinct sorting criteria to different portions of your data. Let's explore how to split an array into two halves and sort the first half in ascending order while sorting the second half in descending order. Syntax // Splitting array into two halves int mid = n / 2; // where n is array size // Bubble sort for ascending order (first half) for (i = 0; i < mid; i++) { ...
Read MoreHow to create an animated, closable side navigation menu with CSS?
To create an animated, closable side navigation menu, we need to combine CSS transitions with JavaScript event handling. The menu slides in from the left when opened and smoothly slides out when closed using CSS width transitions. Syntax .sideNav { width: 0; transition: width 0.5s; position: fixed; } /* JavaScript to toggle width */ element.style.width = "300px"; /* Open */ element.style.width = "0"; /* Close */ Basic Structure The side navigation consists of three main components − ...
Read MoreRepo Rate
The repo rate is the interest rate charged by a central bank when lending funds to commercial banks. It serves as a key monetary policy tool for controlling money supply and liquidity in the economy. Central banks adjust repo rates to influence inflation, economic growth, and overall financial stability. Understanding Repo Rate The repo rate is the most influential tool used by central banks to maintain day-to-day liquidity in an economy. Commercial banks, which serve consumers and operate for profit, borrow money from the central bank to fund their operations. A major portion of these borrowed funds is ...
Read MoreC program to generate the value of x power n using recursive function
In C programming, calculating xn (x raised to the power n) can be efficiently done using recursive functions. This approach breaks down the problem into smaller subproblems, making the solution elegant and mathematically intuitive. Syntax long int power(int x, int n); Algorithm The recursive algorithm uses the following mathematical properties − If n = 1, then xn = x (base case) If n is even, then xn = (xn/2)2 If n is odd, then xn = x × xn-1 Example: Recursive Power Function Here's a complete C program that ...
Read MoreWhat are different variations of for loop iterations?
The for loop in C offers several variations beyond its standard form, making it a versatile control structure. Each variation serves specific programming needs, from multiple variable initialization to infinite loops. Syntax for (initialization; condition; increment/decrement) { // statements } The basic components are − Initialization − Sets the initial value of loop control variable(s) Condition − Tests whether to continue the loop execution Operation − Updates the loop variable after each iteration Variation 1: Multiple Variable Initialization The comma operator allows initializing multiple variables in ...
Read MoreHow to add a search box inside a responsive navigation menu?
To add a search box inside a responsive navigation menu, you need to combine navigation links with an input element and use CSS to style and position them appropriately. The search box should adapt to different screen sizes using media queries. Syntax nav { /* Navigation container styles */ } .links { /* Navigation link styles */ } input[type="text"] { /* Search box styles */ } @media screen and (max-width: breakpoint) { /* Responsive styles */ } ...
Read More