Articles on Trending Technologies

Technical articles with clear explanations and examples

C Program to Redeclaration of global variable

Sunidhi Bansal
Sunidhi Bansal
Updated on 15-Mar-2026 1K+ Views

In C programming, variable redeclaration refers to declaring a variable more than once in the same scope. The behavior of redeclaration varies between global and local variables, and differs between C and C++. Understanding these differences is crucial for avoiding compilation errors. Syntax // Global variable redeclaration int var; int var; // Allowed in C without initialization // Local variable redeclaration int main() { int var; int var; // Not allowed in C } Global Variable Redeclaration Without Initialization C allows ...

Read More

How to create a full-page background image with CSS?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 867 Views

Creating a full-page background image with CSS allows you to display an image that covers the entire viewport. This technique is commonly used for hero sections, landing pages, and creating immersive visual experiences. Syntax .background { background-image: url('image-url'); background-size: cover; background-position: center; background-repeat: no-repeat; height: 100vh; } Key Properties PropertyValueDescription background-sizecoverScales image to cover entire container background-positioncenterCenters the image in the container background-repeatno-repeatPrevents image from repeating height100vhSets height to full viewport ...

Read More

C program to demonstrate usage of variable-length arrays

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 485 Views

Variable-length arrays (VLAs) in C allow you to create arrays whose size is determined at runtime rather than compile time. This feature was introduced in C99 and provides dynamic array allocation on the stack. In this example, we'll demonstrate a library system that uses VLAs to manage books on shelves with three operations: adding books, querying book pages, and counting books per shelf. Syntax data_type array_name[variable_size]; // Where variable_size is determined at runtime Library Management System The system supports three commands − Command 1: Insert a book with y pages at shelf ...

Read More

How to create an image with a transparent background text using CSS?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 860 Views

We can create an image with transparent background text by overlaying text content on an image using CSS positioning and background transparency. This technique uses a semi-transparent background color with the rgba() function to create an overlay effect that makes text readable while keeping the background image visible. Syntax .text-overlay { background: rgba(red, green, blue, alpha); position: absolute; } Method 1: Bottom Overlay Text This approach positions the text overlay at the bottom of the image with a transparent background − ...

Read More

C program to find out the maximum value of AND, OR, and XOR operations that are less than a given value

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 2K+ Views

Suppose we are given two integers k and n. Our task is to perform three operations; bitwise AND, bitwise OR, and bitwise XOR between all pairs of numbers up to range n. We return the maximum value of all three operations between any two pairs of numbers that is less than the given value k. So, if the input is like n = 5, k = 5, then the output will be 4 3 4. The greatest value of AND, OR, and XOR operations between all pairs of numbers that are less than 5 are 4, 3, and ...

Read More

C program to sort triangles based on area

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 1K+ Views

Suppose we have an array of different triangles where triangles[i] = [ai, bi, ci] these are the sides of ith triangle. We shall have to sort the triangles based on their area. The area of a triangle using sides is calculated with Heron's formula: square root of p*(p-a)*(p-b)*(p-c) where p = (a+b+c)/2. So, if the input is like (7, 24, 25), (5, 12, 13), (3, 4, 5), then the output will be (3, 4, 5), (5, 12, 13), (7, 24, 25) Syntax struct Triangle { int a, b, c; }; int ...

Read More

How to add visual effects to images with CSS?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 650 Views

The CSS filter property is used to apply visual effects to images such as blur, brightness, contrast, drop shadow, grayscale, and more. This property allows you to enhance or modify the appearance of images directly through CSS without needing image editing software. Syntax selector { filter: none | blur() | brightness() | contrast() | drop-shadow() | grayscale() | hue-rotate() | invert() | opacity() | saturate() | sepia() | url(); } Common Filter Effects Filter FunctionDescriptionValues blur()Applies blur effectpx values (e.g., 5px) brightness()Adjusts brightness0% to 100%+ (100% = normal) contrast()Adjusts ...

Read More

C program to find sum, max and min with Variadic functions

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 2K+ Views

Variadic functions in C allow you to create functions that can accept a variable number of arguments. This is useful when you need functions like sum(), max(), and min() that can work with different numbers of input values. To implement variadic functions, we use the ellipsis (...) notation and include the header file. Syntax return_type function_name(fixed_parameter, ...); The key macros for handling variable arguments are − va_list: Stores information about variable arguments va_start: Initializes the va_list to start accessing arguments va_arg: Retrieves the next argument of specified type va_end: Cleans up the ...

Read More

How to create an image overlay zoom effect on hover with CSS?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 1K+ Views

The image overlay zoom effect on hover creates a smooth animation where a colored overlay scales up when the mouse cursor hovers over an image. This effect uses the :hover selector combined with CSS transforms and transitions to create an engaging visual interaction. Syntax .container:hover .overlay { transform: scale(1); transition: transform duration ease-function; } HTML Structure First, create a container with an image and overlay div ? Caption Text ...

Read More

C program to find permutations of given strings

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 6K+ Views

In C, generating permutations of strings means finding all possible arrangements of a given array of strings. We can use the next permutation algorithm to systematically generate all permutations in lexicographical order. Syntax int next_permutation(int n, char **strings); Algorithm The next permutation algorithm works by − Finding the rightmost element that is smaller than its next element Finding the smallest element on the right side that is larger than the found element Swapping these two elements Reversing the sequence after the original smaller element Example Let us see the ...

Read More
Showing 20241–20250 of 61,299 articles
Advertisements