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 to write all digits into words using for loop
In C programming, converting digits to their word equivalents is a common task that helps beginners understand conditional statements and loops. This program takes a range of digits and prints each digit as its corresponding word using a for loop. Syntax for(initialization; condition; increment) { // Convert digit to word using if-else statements } Example: Converting Digits to Words in a Range This example demonstrates how to convert all digits from 3 to 8 into their word representations using a for loop − #include void digitToWord(int ...
Read MoreHow to create a pill navigation menu with CSS?
A pill navigation menu features rounded, button-like navigation links that resemble pills. This design provides an intuitive and modern user interface for website navigation. The pill shape is achieved using CSS border-radius property to create rounded corners. Syntax nav { /* Container styles */ } nav a { border-radius: value; /* Other pill styling */ } Example: Creating a Pill Navigation Menu The following example demonstrates how to create a complete pill navigation menu with hover effects and active states − ...
Read MoreC program to convert digit to words
In C programming, converting a digit to its corresponding word representation is a common task. This involves taking a single digit (0-9) and converting it to its English word equivalent like "Zero", "One", "Two", etc. Syntax void digitToWord(int digit); Method 1: Using If-Else Statements This approach uses a series of if-else statements to check each digit and print the corresponding word − #include void digitToWord(int d) { if (d < 0 || d > 9) { printf("Beyond range ...
Read MoreHow to create a fixed social media icon bar with CSS?
A fixed social media icon bar allows users to access your social media profiles from anywhere on the page. The bar remains visible even when scrolling, making it convenient for visitors to connect with you on different platforms. Syntax .social-bar { position: fixed; top: value; left/right: value; } Example The following example creates a fixed social media icon bar that stays positioned on the left side of the page − * { ...
Read MoreC program to find sum and difference using pointers in function
In C programming, functions can return only one value at a time. However, when we need to calculate multiple results like sum and difference of two numbers, we can use pointers as function parameters. This technique allows us to modify the original variables directly through their memory addresses. Syntax void functionName(int *ptr1, int *ptr2); // Call the function functionName(&variable1, &variable2); Algorithm To solve this problem, we will follow these steps − Define a function that takes addresses of two variables as parameters Store the sum in a temporary variable Calculate the difference ...
Read MoreC program to find maximum of four integers by defining function
In C programming, we can find the maximum of four integers by defining our own function. We create a max() function that compares two numbers and returns the larger one, then use it repeatedly to find the maximum among all four numbers. So, if the input is like a = 5, b = 8, c = 2, d = 3, then the output will be 8. Syntax int max(int x, int y); Algorithm To solve this, we will follow these steps − Define a function max() that takes two integers x ...
Read MoreHow to create a \"button group\" with CSS?
A button group is a set of buttons styled to appear connected as a single unit. This creates a cohesive interface element where related actions are grouped together. Button groups are commonly used for navigation, social media links, or filter options. Syntax .button-group { display: inline-block; } .button-group button { float: left; border: none; padding: value; } .button-group button:hover { background-color: value; } Example: Basic Button Group The following example creates a ...
Read MoreC program to find sum and difference of two numbers
In C programming, finding the sum and difference of two numbers is a fundamental operation. This program demonstrates how to perform arithmetic operations on different data types and handle the output formatting correctly based on the operands' types. Syntax // For integer arithmetic int result = num1 + num2; int result = num1 - num2; // For floating-point arithmetic float result = num1 + num2; float result = num1 - num2; Example 1: Sum and Difference of Integer Numbers This example shows basic arithmetic operations on integer values − ...
Read MoreHow to create a pagination with CSS?
When you give page numbers to each page of a book, it is called pagination. On a website, pagination allows dividing content across multiple pages with a series of interconnected links. It helps users navigate through large amounts of content by showing page numbers like 1, 2, 3, 4, 5 along with previous and next navigation buttons. Syntax .pagination { display: inline-block; /* Additional styling properties */ } .pagination a { display: inline-block; padding: value; text-decoration: ...
Read MoreC Program to read and write character string and sentence
In C programming, reading different types of input requires different functions. Reading a single character uses scanf() with %c, strings without spaces use scanf() with %s, and sentences with spaces require fgets() for proper handling. Syntax // Character input scanf("%c", &character); // String input (no spaces) scanf("%s", string); // Sentence input (with spaces) fgets(sentence, size, stdin); Example This program demonstrates reading a character, string, and sentence from user input − #include int main() { char character; char string[500]; ...
Read More