Articles on Trending Technologies

Technical articles with clear explanations and examples

Modulus of Negative Numbers in C

Smita Kapse
Smita Kapse
Updated on 15-Mar-2026 2K+ Views

In C programming, the modulus operator (%) can be used with negative numbers, but the result depends on the sign of the dividend (left operand). The sign of the result always matches the sign of the dividend, regardless of the divisor's sign. Syntax result = dividend % divisor; Rule for Sign Determination The sign of the modulus result follows this rule − If dividend is positive, result is positive If dividend is negative, result is negative The divisor's sign does not affect the result's sign Example 1: Positive Dividend, Negative ...

Read More

How to check if URL Contain Certain String using PHP

Pradeep Kumar
Pradeep Kumar
Updated on 15-Mar-2026 5K+ Views

In PHP, you can check if a URL contains a certain string using built−in functions like strpos() for simple substring matching or preg_match() for pattern matching with regular expressions. Using strpos() Function The strpos() function finds the position of the first occurrence of a substring within a string. It returns the starting index if found, or false if the substring doesn't exist. Syntax int strpos( $string, $substring ) $string: The text where searching is performed. $substring: The pattern or substring to be searched. Example The URL ...

Read More

Scansets in C

Nishtha Thakur
Nishtha Thakur
Updated on 15-Mar-2026 4K+ Views

Scansets in C are special format specifiers supported by the scanf() family of functions. They allow you to specify which characters to accept or reject when reading input. Scansets are represented by %[] and provide fine-grained control over input validation. Syntax %[characters] // Accept only specified characters %[^characters] // Accept all characters except specified ones %[character-range] // Accept characters within a range Example 1: Basic Character Set This example demonstrates how to read only uppercase letters using a character ...

Read More

How to Check form Submission in PHP?

Pradeep Kumar
Pradeep Kumar
Updated on 15-Mar-2026 3K+ Views

To check form submission in PHP, you can use several methods to determine if a form has been submitted and process the data accordingly. The most common approach is checking the request method or specific form fields. Method 1: Checking Request Method The most reliable way is to check if the request method is POST ? Method 2: Using isset() Function You can check if a specific form field or submit button exists ? Complete Example HTML Form (index.html) ...

Read More

Benefits of C over other languages

Smita Kapse
Smita Kapse
Updated on 15-Mar-2026 2K+ Views

The C programming language was developed by Dennis Ritchie during early 1970. It was developed to redesign the UNIX operating system. Earlier the B language, which was used for UNIX system, had different drawbacks. It did not support structures, and did not understand datatypes. For this reason, the C language was introduced. C has high level functionality, and detailed features for OS programming. The UNIX kernel was developed using C. Advantages of C Language Medium Level Language: C is a medium level language. It has both, the lower level and higher level functionality. We can use ...

Read More

How to Change the Maximum Upload file Size in PHP

Pradeep Kumar
Pradeep Kumar
Updated on 15-Mar-2026 357 Views

In PHP, the maximum upload file size is controlled by configuration directives in the php.ini file. By default, PHP sets relatively low limits for file uploads, but you can modify these settings to accommodate larger files. Key Configuration Directives Two main directives control file upload limits − upload_max_filesize − Maximum size for individual uploaded files post_max_size − Maximum size for the entire POST request (should be larger than upload_max_filesize) Step-by-Step Configuration Step 1: Locate php.ini File Find your php.ini file location. For XAMPP users, it's typically located at C:\xampp\php\php.ini. You can also ...

Read More

C/C++ Struct vs Class

Smita Kapse
Smita Kapse
Updated on 15-Mar-2026 471 Views

In C programming, there is no class keyword − only structures (struct) are available. However, understanding the conceptual differences between struct and class is important for C programmers who may work with C++. In C, structures are used to group related data together. Syntax struct structure_name { data_type member1; data_type member2; // ... more members }; Example: Basic Structure in C In C, all structure members are accessible by default − #include struct my_struct { ...

Read More

How to Calculate the Difference Between two Dates in PHP?

Pradeep Kumar
Pradeep Kumar
Updated on 15-Mar-2026 10K+ Views

Calculating the difference between two dates is a common requirement in PHP applications. PHP provides several approaches to achieve this, from simple mathematical calculations to object-oriented methods using the DateTime class. Using date_diff() Function The date_diff() function calculates the difference between two DateTime objects and returns a DateInterval object representing the time difference − +6 years 0 months Using Mathematical Formula with Timestamps This approach converts dates to Unix timestamps and uses mathematical calculations to determine the difference in years, months, days, hours, minutes, and seconds − ...

Read More

What does the operation c=a+++b mean in C/C++?

Aman Kumar
Aman Kumar
Updated on 15-Mar-2026 2K+ Views

In C, the expression c = a+++b is parsed by the compiler using the "maximal munch" rule, which means it reads the longest possible token sequence. This expression is interpreted as c = (a++) + b, where a++ is the post-increment operator applied to variable a. Syntax c = a++ + b; // Post-increment a, then add b c = a + ++b; // Pre-increment b, then add to a The key difference lies in operator precedence and associativity. The post-increment operator (++) has higher precedence than the addition ...

Read More

Enumerations in PHP

Pradeep Kumar
Pradeep Kumar
Updated on 15-Mar-2026 270 Views

Enumerations in PHP provide a way to define a fixed set of named constants, making your code more readable and preventing invalid values. While older PHP versions required workarounds, PHP 8.1 introduced native enum support. Native Enums (PHP 8.1+) PHP 8.1 introduced true enumeration support with the enum keyword − Order status: PENDING Order status: APPROVED Backed Enums Backed enums allow you to assign specific values to enum cases − Priority value: 3 Priority name: HIGH From value 2: MEDIUM Legacy ...

Read More
Showing 1–10 of 61,284 articles
« Prev 1 2 3 4 5 6129 Next »
Advertisements