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 for Reversed String Pattern
In C programming, a reversed string pattern is a way to display a string in a triangular format where each row contains characters in reverse order, and when the string runs out, asterisks (*) fill the remaining positions. This creates an interesting visual pattern that grows row by row. Syntax void printReversedPattern(char str[], int length); Algorithm The approach to create this pattern involves the following steps − Start from the first row and print increasing number of characters For each row, calculate the starting position using formula: k = ((i*(i+1))/2)-1 Print characters ...
Read MoreRole of CSS :empty Selector
The CSS :empty selector targets elements that contain no children. An element is considered empty if it has no child elements, no text content, and no whitespace. This pseudo-class is useful for styling placeholder elements or removing unwanted margins from empty containers. Syntax selector:empty { /* CSS properties */ } What Counts as Empty An element is considered empty if it contains: No child elements No text content No whitespace (spaces, tabs, line breaks) Example: Styling Empty Paragraphs The following example demonstrates how to apply different ...
Read MoreC Program to check if an Array is Palindrome or not
Given an array arr[] of any size n, our task is to find out whether the array is palindrome or not. A palindrome is a sequence which reads the same backwards and forwards, like: MADAM, NAMAN, etc. To check if an array is palindrome, we compare elements from both ends moving towards the center − 1 2 3 2 1 ...
Read MoreRole of CSS: disabled Selector
The CSS :disabled selector is used to style form elements that have the disabled attribute. This pseudo-class selector targets input fields, buttons, and other form controls that are disabled and cannot be interacted with by users. Syntax :disabled { /* CSS properties */ } element:disabled { /* CSS properties */ } Example The following example demonstrates how to style enabled and disabled input fields with different background colors − ...
Read MoreC Program to check Plus Perfect Number
A Plus Perfect Number (also known as Armstrong Number or Narcissistic Number) is a number where the sum of its digits raised to the power of the number of digits equals the original number itself. Syntax int isPlusPerfect(int number); For example − 371: 3³ + 7³ + 1³ = 27 + 343 + 1 = 371 ✓ 163: 1³ + 6³ + 3³ = 1 + 216 + 27 = 244 ≠ 163 ✗ Plus Perfect Number Check: 371 ...
Read MoreCSS position: fixed;
The CSS position: fixed; property positions an element relative to the viewport, which means it stays in the same place even when the page is scrolled. Fixed elements are removed from the normal document flow and positioned using the top, right, bottom, and left properties. Syntax selector { position: fixed; top: value; right: value; bottom: value; left: value; } Possible Values PropertyValueDescription positionfixedSets the positioning method to fixed toplength | %Distance from the ...
Read MoreRole of CSS :checked Selector
The CSS :checked pseudo-class selector targets and styles input elements of type checkbox or radio button that are currently checked or selected. This selector allows you to apply specific styles to form controls based on their state. Syntax input:checked { /* CSS properties */ } Example 1: Styling Checked Checkboxes The following example demonstrates how to style checked checkboxes with enhanced size and background color − input[type="checkbox"]:checked { width: 25px; ...
Read MoreC Program to convert first character uppercase in a sentence
Given a string with mixed case letters, the task is to convert the first character of each word to uppercase and the rest to lowercase. This creates a proper title case format where each word begins with a capital letter. For example, given the string "hElLo world", we need to convert the first character 'h' to uppercase 'H' and make all other characters lowercase except for the first character after spaces, which should also be uppercase. Syntax void convertToTitleCase(char str[], int n); Example Input and Output Input: str[] = {"heLlO wORLD"} Output: ...
Read MoreStyle the active link with CSS
To style the active links, use the CSS :active selector. The :active pseudo-class targets an element during the exact moment it is being clicked or activated by the user. Syntax selector:active { property: value; } Example: Basic Active Link Styling The following example changes the background color of a link when it's being clicked − a { color: blue; text-decoration: none; ...
Read MoreC Program to check if a date is valid or not
In C programming, validating a date requires checking multiple constraints including day, month, year ranges, leap years, and month-specific day limits. A valid date should range from 1/1/1800 to 31/12/9999. Syntax int datevalid(int day, int month, int year); int isleap(int year); Date Validation Constraints Date must be between 1 and 31 Month must be between 1 and 12 Year must be between 1800 and 9999 April, June, September, November have maximum 30 days February has 29 days in leap years, 28 days otherwise Example: Complete Date Validation This program implements ...
Read More