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
Use CSS max-width property for responsive image
The CSS max-width property is essential for creating responsive images that scale down automatically based on their container size. When set to 100%, it ensures images never exceed their parent element's width while maintaining their aspect ratio. Syntax img { max-width: 100%; height: auto; } How It Works The max-width: 100% property prevents images from being larger than their container, while height: auto maintains the image's proportions by automatically adjusting the height based on the width. Example: Responsive Image The following example demonstrates how ...
Read MoreFinding number of alphabets, digits and special characters in strings using C language
In C programming, we can analyze a string to count different types of characters - alphabets, digits, and special characters. This is useful for string validation and data processing tasks. Syntax for(i = 0; string[i] != '\0'; i++) { if((string[i] >= 'a' && string[i] = 'A' && string[i] = '0' && string[i] = 'a' && string[i] = 'A' && string[i] = '0' && string[i]
Read MoreUse CSS width property for responsive image
The CSS width property is essential for creating responsive images that automatically scale with their container. Setting the width to 100% makes an image responsive by ensuring it never exceeds its parent container's width. Syntax img { width: 100%; height: auto; } Example The following code demonstrates how to make an image responsive using the width property − .container { ...
Read MoreWhat are character analysis function, explain with C program?
Character analysis functions in C are predefined functions in the ctype.h library used for analyzing and categorizing character input. These functions help determine the type of character (alphabet, digit, space, etc.) and convert between uppercase and lowercase letters. Syntax #include int isalpha(int c); int isdigit(int c); int isupper(int c); int islower(int c); int toupper(int c); int tolower(int c); Character Analysis Functions S.No Function Description 1 isalpha() Checks if character is an alphabet (a-z, A-Z) 2 isdigit() Checks if character is a digit (0-9) ...
Read MoreBuilding a Responsive Grid-View with CSS
A responsive grid-view is a flexible layout system that adapts to different screen sizes, automatically adjusting the arrangement and sizing of elements. In CSS, you can create responsive grids using modern techniques like CSS Grid or Flexbox. Syntax /* CSS Grid Approach */ .container { display: grid; grid-template-columns: repeat(auto-fit, minmax(min-width, 1fr)); gap: spacing; } /* Flexbox Approach */ .container { display: flex; flex-wrap: wrap; gap: spacing; } Method 1: Using ...
Read MoreWorking with two-dimensional array at runtime in C programming
In C programming, working with two-dimensional arrays at runtime involves dynamically allocating memory and performing operations on the array elements. This approach allows for flexible array sizes determined during program execution. Syntax // Static array declaration int array[rows][cols]; // Dynamic allocation for 2D arrays int **array = (int**)malloc(rows * sizeof(int*)); for(int i = 0; i < rows; i++) { array[i] = (int*)malloc(cols * sizeof(int)); } Problem Write a C program to calculate sum and product of all elements in two-dimensional arrays using runtime operations. Solution Runtime ...
Read MoreUsage of CSS align-content property space-between value
The CSS align-content property with space-between value distributes flex lines evenly within the container, placing equal space between lines with no space at the start and end. Syntax selector { align-content: space-between; } Example The following example demonstrates how space-between distributes flex lines with equal spacing between them − .mycontainer { display: flex; ...
Read MoreFinding even and odd numbers in a set of elements dynamically using C language
In C programming, we can find and calculate the sum of even and odd numbers from a set of elements using dynamic memory allocation. This approach allows us to handle variable-sized datasets efficiently by allocating memory at runtime. Syntax ptr = (int *)malloc(n * sizeof(int)); if (ptr == NULL) { // Handle memory allocation failure } // Use the allocated memory free(ptr); Algorithm The logic to separate even and odd numbers is straightforward − Even numbers: Numbers divisible by 2 (remainder is 0 when divided by 2) Odd ...
Read MoreSet the width of the rule between columns with CSS
The CSS column-rule-width property is used to set the width of the rule (line) between columns in a multi-column layout. This property works in conjunction with column-rule-style and column-rule-color to create visual separators between columns. Syntax selector { column-rule-width: value; } Possible Values ValueDescription thinA thin rule (typically 1px) mediumA medium rule (typically 3px) - default value thickA thick rule (typically 5px) lengthA specific width in px, em, rem, etc. Example: Setting Column Rule Width The following example demonstrates how to set different widths for column ...
Read MoreExplain dynamic memory allocation in C with an example
Dynamic memory allocation in C allows programmers to allocate and deallocate memory during program execution rather than at compile time. This provides flexibility to handle varying data sizes efficiently. Syntax void* malloc(size_t size); void* calloc(size_t num, size_t size); void* realloc(void* ptr, size_t new_size); void free(void* ptr); Dynamic Memory Allocation Functions The main functions used for dynamic memory allocation in C are − malloc() − allocates a block of memory in bytes at runtime calloc() − allocates continuous blocks of memory and initializes them to zero realloc() − used to resize previously allocated ...
Read More