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 Vrundesha Joshi
Page 4 of 22
How do I add two numbers without using ++ or + or any other arithmetic operator in C/C++?
In this article we will see how to add two numbers without using arithmetic operators like +, ++, -, or --. This technique uses bitwise operations to simulate binary addition. To solve this problem, we can use binary adder logic. In digital circuits, we design half adder and full adder circuits that can add one-bit binary numbers. By cascading multiple adders, we can create circuits to add bigger numbers. In binary addition, we perform XOR operation for the sum bits, and AND operation for the carry bits. These principles are implemented here to add two numbers using only ...
Read MoreWhy C treats array parameters as pointers?
In C, array parameters are automatically converted to pointers when passed to functions. This behavior is a fundamental design decision that improves memory efficiency and prevents unnecessary copying of large data structures. Syntax void function(int arr[]); // Array parameter syntax void function(int *arr); // Equivalent pointer syntax void function(int arr[10]); // Size is ignored Why Arrays Become Pointers When you pass an array to a function, C automatically passes the address of the first element instead of copying the entire array. This approach offers several advantages ...
Read MoreHow to detect integer overflow in C/C++?
Integer overflow occurs when an arithmetic operation produces a result that exceeds the maximum value that can be stored in the data type. Detecting overflow before it happens is crucial for preventing undefined behavior and security vulnerabilities in C programs. Syntax // For addition overflow detection if (a > MAX_VALUE - b) { // Overflow would occur } // For unsigned addition if (result < operand1 || result < operand2) { // Overflow occurred } Method 1: Pre-computation Check for Signed Integers The safest approach ...
Read MoreConvert a floating point number to string in C
In C, converting a floating point number to a string is accomplished using the sprintf() function. This function works similarly to printf(), but instead of printing to the console, it writes the formatted output to a string buffer. Syntax int sprintf(char *str, const char *format, ...); Parameters: str − Pointer to the destination string buffer format − Format string specifier (e.g., "%f" for float) ... − Variable arguments to be formatted Example 1: Basic Float to String Conversion The following example demonstrates converting a floating point number to a string using ...
Read MoreUsing combination of "AND" and "OR" in SELECT in ABAP
You can combine AND and OR operators in ABAP SELECT statements to create complex filtering conditions. This allows you to specify multiple criteria that must be met simultaneously while also providing alternative options for certain fields. Using AND with OR in Parentheses You can use the following query to combine conditions − SELECT * FROM my_table WHERE condition_1 AND condition_2 AND ( id EQ '2' OR id EQ '3' ). Note: There should be space after and before the bracket for proper syntax formatting. In this example, both condition_1 and condition_2 must be ...
Read MoreFinding a particular value in internal table itab in ABAP
You can use a READ statement in combination with TRANSPORTING NO FIELDS to find a particular value in an internal table without transferring data to a work area. This approach is more efficient as it skips the data transfer process and avoids unnecessary loops. Basic Syntax The TRANSPORTING NO FIELDS clause tells ABAP to only check if the record exists without copying any field values to the work area − READ TABLE itab WITH KEY field_name = 'value' TRANSPORTING NO FIELDS. IF sy-subrc = 0. " Record found - perform required actions ELSE. ...
Read MoreBuilding a mobile app using OpenUI5 and Cordova using framework like jQuery.sap.storage
You are thinking correctly for your requirement. What you can do is, use the read method for each entityset to read the oData. In the success callback for this method, you can parse the result objects into a corresponding JSON model. Now, you can have working logic as per which − When you are online, use the additional layer to fill the JSON model from the oData that has been read When offline, you can read from local storage Implementation Approach The jQuery.sap.storage API provides local ...
Read MoreResource routing not working when using SAP Fiori
Resource routing issues in SAP Fiori applications commonly occur due to duplicate application IDs or connectivity problems. This article explains how to resolve these routing conflicts and connectivity issues. Duplicate Application ID Issue The primary issue you are facing is because you have created both the applications with the same ID. Hence, the Launchpad is not able to distinguish between them and load into the correct context. You can change the application ID and all the references of the same to resolve the ...
Read MoreHow to refer and import SAP-UI-Core.js within my SAPUI5 project
The SAPUI5 library files are a part of Eclipse SAPUI5 plug-in. The sap-ui-core.js file is the core JavaScript file that bootstraps the SAPUI5 framework and must be properly referenced in your project. If you are running the app by using the Web App preview on the startup page (Go to Run As → select "Web APP Preview"), then Eclipse starts a local HTTP server for development which serves the library at "/resources". Till the preview window is open, you can go ahead and use the URL in any browser of your choice to debug the application. Methods ...
Read MoreCenter Triangle at Bottom of Div in HTML with CSS
To create a triangle at the center and bottom of a , you can use the CSS ::after pseudo-element with the border trick. The triangle is formed by setting a colored top border and transparent left and right borders on a zero-width, zero-height element. It is then positioned at the bottom center of the parent div. How the CSS Triangle Trick Works When you set borders on an element with zero width and height, the borders meet at angles and form triangular shapes. By making only the top border visible (colored) and the left and right borders transparent, you get ...
Read More