Articles on Trending Technologies

Technical articles with clear explanations and examples

C program to check if a given string is Keyword or not?

sudhir sharma
sudhir sharma
Updated on 15-Mar-2026 14K+ Views

In C programming, a keyword is a predefined or reserved word that has a fixed meaning and is used to perform specific operations. The C language has 32 keywords that cannot be used as variable names or identifiers. Syntax int strcmp(const char *str1, const char *str2); We can check if a string is a keyword by comparing it with all C keywords using the strcmp() function. C Keywords The following table lists all 32 keywords in the C programming language − ...

Read More

Set the width of the left border using CSS

seetha
seetha
Updated on 15-Mar-2026 87 Views

The CSS border-left-width property is used to set the width of the left border of an element. This property only works when the border-left-style or border-style is defined. Syntax selector { border-left-width: value; } Possible Values ValueDescription thinDefines a thin left border mediumDefines a medium left border (default) thickDefines a thick left border lengthDefines the width in px, em, rem, etc. Example The following example demonstrates how to set different widths for the left border − ...

Read More

Sum of the series 1.2.3 + 2.3.+ ... + n(n+1)(n+2) in C

sudhir sharma
sudhir sharma
Updated on 15-Mar-2026 824 Views

Find the sum up to n terms of the series: 1.2.3 + 2.3.4 + ... + n(n+1)(n+2). In this series, 1.2.3 represents the first term and 2.3.4 represents the second term. Let's see an example to understand the concept better − Input: n = 5 Output: 420 Explanation 1.2.3 + 2.3.4 + 3.4.5 + 4.5.6 + 5.6.7 = 6 + 24 + 60 + 120 + 210 = 420 The nth term = n(n+1)(n+2); where n = 1, 2, 3, ... Expanding: n(n+1)(n+2) = n(n² + 3n + 2) = n³ + ...

Read More

Set the style of the bottom border using CSS

George John
George John
Updated on 15-Mar-2026 267 Views

The CSS border-bottom-style property is used to set the style of the bottom border of an element. You can create various visual effects like dotted, dashed, solid, and other border styles. Syntax selector { border-bottom-style: value; } Possible Values ValueDescription noneNo border (default) solidA solid line border dottedA series of dots dashedA series of dashes doubleTwo solid lines insetBorder appears embedded outsetBorder appears raised Example The following example demonstrates different bottom border styles − p { ...

Read More

Betrothed numbers in C?

sudhir sharma
sudhir sharma
Updated on 15-Mar-2026 2K+ Views

Betrothed numbers are pairs of numbers where the sum of proper divisors of each number equals the other number plus one. In mathematical terms, for numbers (a, b) to be betrothed: s(a) = b + 1 and s(b) = a + 1, where s(n) represents the sum of proper divisors of n (divisors excluding the number itself). The first few pairs of betrothed numbers are: (48, 75), (140, 195), (1050, 1925), (1575, 1648), (2024, 2295), (5775, 6128). All known pairs have opposite parity − one number is even and the other is odd. Syntax int sumOfProperDivisors(int ...

Read More

Show the background image only once with CSS

Giri Raju
Giri Raju
Updated on 15-Mar-2026 893 Views

Use the background-repeat property to display the background image only once. By default, background images repeat to fill the entire element, but you can control this behavior with the background-repeat property. Syntax selector { background-repeat: value; } Possible Values ValueDescription no-repeatBackground image displays only once repeatBackground image repeats both horizontally and vertically (default) repeat-xBackground image repeats only horizontally repeat-yBackground image repeats only vertically Example The following code shows how to display a background image only once using background-repeat: no-repeat − ...

Read More

Role of CSS :nth-last-of-type(n) Selector

mkotla
mkotla
Updated on 15-Mar-2026 222 Views

The CSS :nth-last-of-type(n) selector targets elements based on their position among siblings of the same type, counting from the last element backwards. It's particularly useful for styling specific elements without adding classes or IDs. Syntax :nth-last-of-type(n) { /* CSS properties */ } Possible Values ValueDescription numberSelects the nth element from the end (1, 2, 3, etc.) evenSelects even-positioned elements from the end oddSelects odd-positioned elements from the end formulaUses expressions like 2n+1, 3n, etc. Example: Selecting Second Last Element The following example selects the second last ...

Read More

Array elements that appear more than once in C?

sudhir sharma
sudhir sharma
Updated on 15-Mar-2026 1K+ Views

An array is a container of elements of the same data type. Elements can appear in any order and frequency within an array. In this article, we will learn how to find elements that appear more than once in an array. Syntax for (i = 0; i < n; i++) { count = 0; for (j = 0; j < n; j++) { if (arr[i] == arr[j]) { count++; ...

Read More

Set Responsive Font Size using CSS

radhakrishna
radhakrishna
Updated on 15-Mar-2026 390 Views

Setting responsive font size in CSS ensures text adapts to different screen sizes automatically. The vw (viewport width) unit is the most common approach, making text scale proportionally with the browser width. Syntax selector { font-size: value vw; } Viewport Units for Responsive Font Size UnitDescription vw1% of viewport width vh1% of viewport height vmin1% of smaller viewport dimension vmax1% of larger viewport dimension Example: Basic Viewport Width Font Size The following example demonstrates responsive font sizing using the vw unit − ...

Read More

Array sum after dividing numbers from previous in C?

sudhir sharma
sudhir sharma
Updated on 15-Mar-2026 320 Views

In C programming, we can calculate the sum of an array where each element (except the first) is divided by its preceding element. This problem involves integer division, where we only consider the quotient part of the division. Syntax sum = arr[0]; for(i = 1; i < n; i++) { sum += arr[i] / arr[i-1]; } Algorithm The algorithm traverses each element of the array and divides it by the element preceding it. Then, it adds the quotient value to the sum variable − Input : Array - ...

Read More
Showing 21291–21300 of 61,297 articles
Advertisements