Found 33676 Articles for Programming

Subtract 1 Without Arithmetic Operators

Rinish Patidar
Updated on 21-Aug-2023 18:30:20

586 Views

This problem includes that we need to subtract 1 without using arithmetic operators. We will be given any integer N as input in the problem and we need to subtract 1 from the number or simply we need to print N-1. Our task is to perform the operation without using any arithmetic operators. The arithmetic operations involves variety of operations on numbers like addition(+), subtraction(-), multiplication(*), division(/), modulo(%), etc. These operations are supported by every programming language on numbers. Despite using this we need to subtract 1 from the number. For example, Input 7 Output 6 Explanation ... Read More

Sorting of Vector of Tuple in C++ (Ascending Order)

Rinish Patidar
Updated on 21-Aug-2023 18:12:03

2K+ Views

We will discuss sorting the vector of Tuple in C++ in ascending order in this article. A list of elements are stored in a C++ data structure known as a tuple. The same or different data types may be contained in it, and we may access them in the same sequence in which they were initialised as inputs. A tuple's data is organised so that we can retrieve it in the same order. Syntax tuple name In C++, this is how we can initialise a tuple. We may require few more tuple functions to sort the vector ... Read More

Set the Rightmost Unset Bit

Rinish Patidar
Updated on 21-Aug-2023 18:31:40

796 Views

The problem statement includes setting the rightmost unset bit of any positive integer N in C++. A bit is simply a binary digit of any number when represented in the form of a binary number. A binary number is the numerical representation of any data in the form of 0 and 1 where every bit(digit) of the number represents the power of 2 starting with 2^0 from the unit digit. Let's represent an integer 7 in the form of a binary number. The binary representation of 7 will be 111. These numbers can either be represented ... Read More

How to Turn on a Particular Bit in a Number?

Rinish Patidar
Updated on 21-Aug-2023 18:04:56

298 Views

The problem statement says that we need to turn on a particular bit in a number. To put it simply, all we have to do is swap out a certain bit in a number for 1. Provide the same outcome if it has already been 1. You can represent an integer using binary numbers, which come in the forms of 0 and 1 where every digit represents a power of 2. Let's represent 5 in the binary numbers. The binary form of 5 will be 101 i.e.$\mathrm{2^{2} + 2^{0}= 5.}$ In this problem, a number N will ... Read More

Corollaries of Binomial Theorem

Rinish Patidar
Updated on 21-Aug-2023 21:07:46

317 Views

The Binomial Theorem describes how to expand an expression raised to any finite power. A binomial theorem is a powerful expansion tool that has applications in algebra, probability, and other fields. Assume we have an expression $\mathrm{(x\:+\:y)^n}$and we need to expand the expression, we can do this using the generalised equation of binomial theorem. The binomial theorem defines a binomial expression for two different terms. The general equation of binomial theorem is: $$\mathrm{(a+b)^{n}=^n{C_{r=0}}a^{n-r}b^{0}\:+\:^n{C_{r=1}}a^{n-1}b^{1\:}+\:........\:+\:^n{C_{r=n-1}}a^{1}b^{n-1}+^n{C_{r=n}}a^{0}b^{n}}$$ $$\mathrm{=n_{\sum_{r=0}}^n{C_{r}}a^{n-r}b^{r}}$$ Where we can get the value of $\mathrm{^n{C_{r}}}$ using the formula, $$\mathrm{^n{C_{r}}=\frac{n!}{(n-r)!r!}}$$[0! is always equals to 1] NOTE There ... Read More

Check if three Straight Lines are Concurrent or Not

Rinish Patidar
Updated on 21-Aug-2023 17:53:02

392 Views

The problem includes checking if the three given straight lines are concurrent or not. If all three lines in a plane pass through the same point, they are said to be concurrent. They must intersect with each other exactly at one point to be concurrent. The three concurrent lines are depicted in the above illustration. According to the above illustration, the point of intersection of any two lines should be located on the third line to be concurrent. The point of concurrence is the intersection of these lines.As everyone is aware, a straight line can be written as ... Read More

Flipkart Product Price Tracker using Python

Atharva Shah
Updated on 21-Aug-2023 17:09:16

438 Views

Flipkart, one of India's biggest online retailers, offers a variety of products at competitive costs, yet it may be difficult to manually monitor pricing due to Flipkart's rapid price fluctuations in response to discounts and offers. This step-by-step tutorial will teach you how to build a Python Flipkart product price tracker that will allow you to locate reasonable sales pricing and follow price changes in the background. Syntax To build a Flipkart product price tracker using Python, we need to install the following modules − requests − to fetch the webpage of the product BeautifulSoup − to parse the ... Read More

Flight-price checker using Python and Selenium

Atharva Shah
Updated on 27-Feb-2025 17:32:04

835 Views

Web scraping has been a useful technique for extracting data from websites for various purposes, including price checking for airline tickets. In this article, we will explore how to build a flight price checker using Selenium, a popular web testing automation tool. By leveraging Selenium's capabilities, we can automate the process of collecting and comparing prices for flights across different airlines, saving time and effort for users. Setup Firefox Executable Download the Firefox browser installer from here Once downloaded, install the browser and an exe file will be placed automatically in C:\Program Files\Mozilla Firefox\firefox.exe. We will be needing it ... Read More

Flattening JSON objects in Python

Atharva Shah
Updated on 21-Aug-2023 17:07:06

5K+ Views

JSON (JavaScript Object Notation) is a lightweight data interchange format. It is extensively used in web applications for transmitting data between the server and the client. JSON data often comes in a nested format, which can be difficult to manipulate. Flattening JSON objects involves converting complex hierarchical JSON structures to simpler structures. This process is often required when analyzing JSON data or transforming it into a different format. In this blog post, we will explore the process of flattening JSON objects in Python. Syntax Python has a built-in JSON module that provides functions to encode and decode JSON data. data= ... Read More

Flask project – Create a Joke App with PyJokes

Atharva Shah
Updated on 21-Aug-2023 17:05:32

178 Views

Flask is an incredible choice in the event that you're a Python engineer needing to fabricate a web application. It is a lightweight web framework that is easy to use and understand. Using PyJokes, a Python package with a large number of jokes, we'll show you how to use Flask to create an amusing and interactive joke app in this article. Installation and Syntax To get started with our Flask news application, we need to first install Flask and the pyjokes library which will fetch jokes for us randomly pip install pyjokes flask Before we dive into the implementation ... Read More

Advertisements