Swap two arrays without using a temporary variable. We will use arithmetic and bitwise Operators instead of a third variable. The logic to read the first array is as follows − printf("enter first array ele:"); for(i = 0; i < size; i++){ scanf("%d", &first[i]); } The logic to read the second array is as follows − printf("enter first array ele:"); for(i = 0; i < size; i++){ scanf("%d", &first[i]); } The logic to swap the two arrays without using a third variable is as follows − for(i = 0; i < size; i++){ ... Read More
Binary numbers are represented in 1’s and 0’s. It can also be referred to as a rational number with a finite representation in the system. This is a quotient of an integer by a power of two. Hexadecimal number system with 16 digits is {0, 1, 2, 3…..9, A(10), B(11), ……F(15)}. In base 16 transfer encoding, each byte of plain text is divided into two 4-bit values, which are represented by two hexadecimal digits. Converting Binary to Hex using C To convert from binary to hexadecimal representation, the bit string is grouped into 4-bit blocks, called nibbles, starting from the ... Read More
By using justifications in the printf statement, we can format the data in various ways. To implement the right justification, insert a minus sign before the width value in the %s character. printf("%-15s", text); Program 1 The example below prints a table with name and amounts, formatted in two columns with fixed widths for better alignment, using printf() for row and column-wise output. #include int main(){ char a[20] = "Names", b[20]="amount to be paid"; char a1[20] = "Bhanu", b1[20]="Hari", c1[20]="Lucky", d1[20]="Puppy"; int a2 = 200, b2 = 400, c2 = ... Read More
In this article, we are going to learn about the different sorting techniques and their implementations in C language. Sorting in C programming requires rearranging elements in the array into a determined order, i.e., in ascending or descending order. This will use the comparison operator to specify the new order of a list or array. This is widely used in different applications that include searching algorithms, data structure optimization, and database management. The following are the sorting techniques that we can implement with C language and other programming also: ... Read More
When we work with database tables, we need to insert multiple rows into database tables. We can improve the efficiency of SQL queries if we use an efficient method to insert multiple rows into database tables. We can reduce the number of queries sent to the server. We will discuss different methods and their advantages for inserting multiple rows into database tables. You can select your best method depending on your data and your choice. We should follow practices when we insert data into database tables - We should prepare statements for dynamic data to ... Read More
Pythagorean Triples Pythagorean triples are a set of three distinct numbers a, b, and c which satisfy the condition: a2 + b2 = c2 These numbers a, b, and c are known as Pythagorean triples. We can say that these three numbers represent the sides of a right-angled triangle. These three sides are known as triplets of the array. Problem Description We are given an array of integers, and we have to find if there exist three distinct numbers in the array which form the Pythagorean triplet in C++. Below are examples to demonstrate the problem statement clearly: ... Read More
Package Managers is a tool used to install and update software easily in Windows. There are different tools that we need to use daily while working as software engineers. A package manager is used to install, update, manage, and uninstall software and applications. It simplifies the process, saves time, and ensures consistency. It operates through a command-line interface (CLI) which allows us to execute tasks like installing or updating software with a single command. It handles everything in the background, including dependencies. It improves security by preventing malicious software from downloading and installing all applications from official and trustworthy sources. ... Read More
What are Environment Variables?Environment variables are essential for managing sensitive information, such as API keys or database credentials, in a secure and maintainable way. Environment variables are key-value pairs used to configure applications without hardcoding sensitive or environment-specific information into the codebase. They are especially useful for:Storing Sensitive Information: Protect API keys, tokens, and passwords from being exposed in the code.Environment-Specific Configuration: Configure values that vary between development, staging, and production environments.Improved Security: Keep sensitive data out of version control systems like Git.Why Use Environment Variables in Vercel?Vercel provides a simple and secure way to manage environment variables. It supports ... Read More
React is a powerful JavaScript library developed by Facebook for creating user interfaces specifically for single-page applications. The component-based architecture allows developers to create reusable UI components. This makes the development process efficient and maintainable. A typical React application is structured in directories and files. There are different file extensions used in React development, each with a particular purpose. For instance .js or .jsx files are for JavaScript and JSX code, respectively. On the other hand, .css files are for formatting elements. Knowing these file extensions is crucial for several reasons: improves code readability; helps fix bugs and ensures ... Read More
Tables are a common way to organize and display data in HTML. If you're working with tables dynamically in JavaScript, you might need to count the rows in an HTML table for various purposes, such as validation, manipulation, or displaying statistics. In this article, we will demonstrate how to retrieve the row count of an HTML table using JavaScript. We will use the rows Attribute to access the row count through rows.length, while in the other method, we will specifically count the rows through tbody selection. What is rows Attribute? The rows attribute in HTML is used to define the ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP