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
Fixing the Collapsed Parent using CSS
One of the many problems that developers face while using CSS float property is that if all child elements are floated then the parent container will collapse. To avoid parent container collapsing we can use one of the following solutions. The Problem When all child elements inside a parent container are floated, the parent container loses its height and appears to collapse. This happens because floated elements are removed from the normal document flow, so the parent doesn't recognize them when calculating its own height. Example of the Problem The following example demonstrates the collapsed parent ...
Read MoreHow to multiply two matrices using pointers in C?
Matrix multiplication is a fundamental operation in linear algebra. In C programming, we can multiply two matrices using pointers to access matrix elements efficiently. This approach demonstrates how pointer arithmetic works with 2D arrays. Syntax // Matrix multiplication using pointers *(*(result + i) + j) = sum of (*(*(mat1 + i) + k)) * (*(*(mat2 + k) + j)) Understanding Pointer Access in 2D Arrays When working with 2D arrays and pointers − mat[i][j] is equivalent to *(*(mat + i) + j) mat + i points to the i-th row *(mat + ...
Read MoreWrite a C program to print all files and folders.
In C programming, we can list all files and folders in a directory using directory handling functions. This requires the dirent.h header which provides structures and functions to work with directory entries. Syntax DIR *opendir(const char *dirname); struct dirent *readdir(DIR *dirp); int closedir(DIR *dirp); Key Functions opendir() − Opens a directory stream for reading readdir() − Reads directory entries one by one closedir() − Closes the directory stream Note: This program uses dirent.h which is POSIX standard. On Windows with certain compilers, you might need additional setup or use platform-specific ...
Read MoreMeaning of Economic and Non-Economic Activities
Economic activities and non-economic activities form the foundation of human behavior in any economy. Economic activities are performed with the primary motive of earning money and accumulating wealth, while non-economic activities are driven by social, personal, or spiritual satisfaction without any monetary return. Understanding this distinction is crucial for analyzing how individuals and societies allocate their time and resources. What are Economic Activities? Economic activities are activities that are done for earning money and growing wealth. These activities are related to the production, distribution, and consumption of commodities and goods. Economic activities are performed with a profit motive in ...
Read MoreLeft and Right Alignment using the float Property in CSS
The CSS float property is used to position elements horizontally within their container. It allows elements to "float" to the left or right side, making other content wrap around them. This property is commonly used for creating layouts and aligning content. Syntax selector { float: value; } Possible Values ValueDescription leftElement floats to the left side of its container rightElement floats to the right side of its container noneElement does not float (default value) Example: Float Left and Right The following example demonstrates floating elements to ...
Read MoreExplain the quick sort technique in C language.
Quick sort is a highly efficient divide-and-conquer sorting algorithm that works by selecting a 'pivot' element and partitioning the array around it. Elements smaller than the pivot go to the left, and larger elements go to the right, then the process is repeated recursively on both subarrays. How Quick Sort Works The quick sort algorithm follows these steps − Step 1: Choose a pivot element from the array (typically the first, last, or middle element) Step 2: Partition the array so elements less than pivot are on the ...
Read MoreAligning elements using the position property in CSS
The CSS position property is used to control how elements are positioned within their containing element or the viewport. It works together with positioning properties like top, right, bottom, and left to precisely place elements. Syntax selector { position: value; top: value; right: value; bottom: value; left: value; } Position Values ValueDescription staticDefault positioning; follows normal document flow relativePositioned relative to its normal position absolutePositioned relative to nearest positioned ancestor fixedPositioned relative to ...
Read MoreMeaning of Demand and Factors Affecting Demand
Demand refers to a consumer's desire and ability to purchase a product at a given price during a specific time period. When we consider an individual's purchasing behavior, it is called individual demand, while market demand represents the sum of all individual demands in a particular market. Understanding demand is fundamental to economics as it drives market activity and business decisions. Understanding Demand Demand is the cornerstone of economic activity and is governed by two fundamental laws that explain consumer behavior and market dynamics. Law of Demand Law of Diminishing Marginal Utility States ...
Read MoreCenter alignment using the margin property in CSS
We can center horizontally a block-level element by using the CSS margin property, but CSS width property of that element should be set. The auto value is set for the margin property. Syntax selector { margin: top-bottom-value auto; width: value; } The key points for center alignment using margin are − Set a specific width on the element Use margin: auto or margin: value auto The element must be a block-level element Example: Center a Simple Div Let's see a basic example ...
Read MoreC program to print the ASCII values in a string.
In C programming, we can print the ASCII values of characters in a string by iterating through each character and using the %d format specifier to display its numeric ASCII value. Syntax while(str[i] != '\0') { printf("ASCII Value of %c = %d", str[i], str[i]); i++; } String Declaration and Initialization A string in C is an array of characters terminated by a null character '\0'. Declaration: char stringname[size]; Initialization methods: Using character constants: char string[10] = ...
Read More