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 by Bhanu Priya
Page 35 of 107
Create editable content in an HTML document
The contenteditable attribute in HTML allows users to directly edit content on a webpage. This creates interactive elements that behave like text editors within the browser. Syntax The contenteditable attribute can be applied to any HTML element: Values true - Makes the element editable by the user false - Prevents the element from being edited (default behavior) Basic Example Here's a simple demonstration of editable vs non-editable content: Editable Content Demo This content is editable. Click here ...
Read MoreWhat is the difference between HTML tags and ?
We can use both DIV and SPAN tags as containers in HTML, as they both serve different purposes. Both are essential HTML elements for structuring and styling web content. Let's explore each tag in detail. DIV Tag The tag is a block-level element that helps in separating and organizing content like text, images, navigation bars, and other sections. It creates a rectangular block that spans the full width of its container and always starts on a new line. DIV tags can be styled with CSS or manipulated with JavaScript. They are easily targeted using class or ...
Read MoreWhat are the special symbols in C language?
In C programming language, special symbols have specific meanings and are essential for writing syntactically correct programs. This language provides low-level access to memory and is known for its performance and efficiency. The C language includes a character set of English alphabets (a-z, A-Z), digits (0-9), and special characters with specific meanings. Some special characters are operators, while combinations like "" are escape sequences. In C, symbols are used to perform special operations − Syntax [] () {} , ; * = # : . -> + - / % < > ! & | ^ ...
Read MoreHow to convert binary to Hex by using C language?
Binary numbers are represented using only 1's and 0's. Hexadecimal numbers use 16 digits: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F} where A=10, B=11, C=12, D=13, E=14, F=15. Syntax // Convert binary string to decimal first, then to hex int binaryToDecimal(long binary); void decimalToHex(int decimal, char hex[]); Converting Binary to Hex Process To convert binary to hexadecimal, group the binary digits into 4-bit blocks (nibbles) from right to left. Each 4-bit group represents one hexadecimal digit − Binary: 1110 0101 1011 ...
Read MoreC program to insert a node at any position using double linked list
A doubly linked list is a linear data structure where each node contains data and two pointers − one pointing to the previous node and another to the next node. This allows traversal in both directions and efficient insertion/deletion operations at any position. Syntax struct node { int data; struct node *prev; struct node *next; }; void insertAtPosition(int data, int position); Doubly Linked List Structure The doubly linked list structure consists of nodes where each node has three components − ...
Read MoreC program to print Excel column titles based on given column number
In C programming, converting a column number to its corresponding Excel column title is a common problem. Excel columns are labeled as A, B, C, ..., Z, AA, AB, AC, and so on. This follows a base-26 numbering system where A=1, B=2, ..., Z=26, AA=27, etc. Syntax char* convertToExcelTitle(int columnNumber); Algorithm The algorithm works by repeatedly dividing the column number by 26 and converting the remainder to the corresponding character − Subtract 1 from the column number to make it 0-indexed Find the remainder when divided by 26 and convert to character ...
Read MoreC program to represent numbers in numerator and denominator in string format
In C, we can convert fractions to their decimal string representation using dynamic memory allocation. This program handles both terminating and repeating decimal fractions, representing repeating decimals with parentheses. Syntax char* fractionToDecimal(int numerator, int denominator); Algorithm The algorithm works by performing long division and tracking remainders to detect repeating cycles − Calculate the integer part using division Use the remainder to compute decimal digits Store each remainder to detect when a cycle begins Mark repeating portions with parentheses Example Following is the C program to represent fractions in decimal ...
Read MoreWhat is strtok_r() function in C language?
The strtok_r() function is a thread-safe alternative to the strtok() function for tokenizing strings. The "_r" suffix stands for "re-entrant, " meaning this function can be safely interrupted and resumed without losing its state. This makes it ideal for multi-threaded applications where multiple threads might need to tokenize strings simultaneously. A re-entrant function can be interrupted during execution and safely resumed later. Because strtok_r() maintains its context through an external pointer, it avoids the static variable issues that make strtok() non-thread-safe. Syntax char *strtok_r(char *str, const char *delim, char **saveptr); Parameters str ...
Read MoreWhat is C Operator Precedence and Associativity?
In C programming, operator precedence and associativity determine the order in which operators are evaluated in complex expressions. Understanding these concepts is crucial for writing correct C programs and predicting expression results. Operator Precedence Operator precedence defines the priority order in which operators are evaluated in an expression. When multiple operators exist in an expression, the operator with higher precedence is evaluated first. For example, multiplication has higher precedence than addition. Syntax expression = operand1 operator1 operand2 operator2 operand3 /* Evaluation order depends on operator precedence and associativity */ Operator Associativity Operator ...
Read MoreWhat is program development cycle in C language?
When we want to develop a program by using any programming language, we have to follow a sequence of steps. These steps are called phases in program development. The program development life cycle is a set of steps or phases which are used to develop a program in any programming language. Syntax Program Development Life Cycle: 1. Problem Definition 2. Problem Analysis 3. Algorithm Development 4. Coding & Documentation 5. Testing & Debugging 6. Maintenance Phases of Program Development Program development life cycle contains 6 phases, which are as follows − ...
Read More