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
Arrow to the top of the tooltip with CSS
The CSS bottom property combined with border styling can be used to create an arrow pointing to the top of a tooltip. This creates a visual connection between the tooltip and its trigger element. Syntax .tooltip::after { content: ""; position: absolute; bottom: 100%; left: 50%; border-width: size; border-style: solid; border-color: transparent transparent color transparent; } Example The following example creates a tooltip with an arrow pointing ...
Read MoreC program to print number series without using any loop
In this problem, we are given two numbers N and K. Our task is to create a program that will print number series without using any loop. The series starts from N and subtracts K until it becomes zero or negative. After that, we start adding K to it until it becomes N again. We cannot use any type of loop for this process. Syntax void printSeries(int current, int n, int k, int flag); Input/Output Example Input: n = 12, k = 3 Output: 12 9 6 3 0 3 6 9 ...
Read MoreC program to print environment variables
In C programming, environment variables are global system variables that contain information about the operating system and user environment. These variables can affect how running processes behave on the system. C provides access to environment variables through the third parameter of the main() function. Syntax int main(int argc, char *argv[], char *envp[]) Parameters: argc − Number of command-line arguments argv[] − Array of command-line argument strings envp[] − Array of environment variable strings (NULL-terminated) Example: Print All Environment Variables This program iterates through the envp array to print all environment variables ...
Read MoreCenter an image with CSS
Centering an image in CSS can be accomplished using the display: block property combined with margin: 0 auto. This technique works by making the image a block-level element and then applying automatic left and right margins. Syntax img { display: block; margin: 0 auto; } Method 1: Using Block Display and Auto Margins The most common method to center an image horizontally is to set display: block and use margin: 0 auto − .centered-image { ...
Read MoreC Program to list all files and sub-directories in a directory
In C, we can list all files and sub-directories in a directory using the dirent.h header which provides directory handling functions. This is useful for file system operations and directory traversal programs. A directory is a container that stores files and other directories in a hierarchical structure. A subdirectory is a directory contained within another directory, creating nested folder structures. Note: This program requires a POSIX-compliant system (Linux/Unix/macOS). On Windows, you may need to use different headers or compile with specific flags. Syntax DIR *opendir(const char *dirname); struct dirent *readdir(DIR *dirp); int closedir(DIR ...
Read MoreHow to scale down an image with CSS to make it responsive
The CSS max-width and height properties can be used to make images responsive, allowing them to scale down automatically based on the container size while maintaining their aspect ratio. Syntax img { max-width: 100%; height: auto; } Key Properties PropertyValueDescription max-width100%Ensures image never exceeds container width heightautoMaintains aspect ratio automatically Example: Basic Responsive Image The following example demonstrates how to make an image scale down responsively − .container { ...
Read MoreC Program for Matrix Chain Multiplication
In this problem, we are given a sequence (array) of dimensions that define a chain of matrices. Our task is to create a C program for Matrix chain multiplication to find the minimum number of scalar multiplications required to multiply these matrices. The array of matrices will contain n elements, which define the dimensions of the matrices as arr[i-1] × arr[i] for the i-th matrix. Syntax int matrixChainOrder(int dimensions[], int n); Understanding the Problem Let's take an example to understand the problem − Input array[] = {3, 4, 5, 6} ...
Read MoreDisplay a blue shadow on image hover with CSS
To display a blue shadow on image hover, use the CSS box-shadow property with the :hover pseudo-class. This creates an interactive effect that enhances user experience by providing visual feedback when users hover over images. Syntax selector:hover { box-shadow: horizontal-offset vertical-offset blur-radius spread-radius color; } Example: Blue Shadow on Image Hover The following example displays a blue shadow when you hover over the image − img { width: 250px; ...
Read MoreC program to detect tokens in a C program
Here, we will create a C program to detect tokens in a C program. This is called the lexical analysis phase of the compiler. The lexical analyzer is the part of the compiler that detects the token of the program and sends it to the syntax analyzer. Token is the smallest entity of the code. It can be a keyword, identifier, constant, string literal, or symbol. Syntax void detectTokens(char* sourceCode); Types of Tokens Examples of different types of tokens in C − Keywords: for, if, include, while, int, etc. Identifiers: variables, ...
Read MoreAdd more than one shadow to a text with CSS
Whether in graphic design, photography, or even on a web page, adding shadows is a powerful technique to create depth and visual interest. You can apply multiple shadows to text using CSS without needing external image editing software. CSS provides two main properties for creating shadow effects − text-shadow - for adding shadows directly to text box-shadow - for adding shadows to elements containing text To add multiple shadows with CSS, use a comma-separated list of shadow values. Syntax /* Multiple text shadows */ text-shadow: shadow1, shadow2, shadow3; /* Multiple box shadows ...
Read More