Nishu Kumari has Published 122 Articles

Alternate bits of two numbers to create a new number in C++

Nishu Kumari

Nishu Kumari

Updated on 28-Jul-2025 19:26:34

192 Views

Here, we are given two numbers, and we have to create a new number by combining their bits in an alternating way. We take the first bit from the second number, the second bit from the first number, the third bit from the second again, and so on. We ... Read More

Add Bold Tag in String in C++

Nishu Kumari

Nishu Kumari

Updated on 25-Jul-2025 13:00:47

3K+ Views

 A string is a sequence of characters, like words, numbers, or sentences, enclosed in double quotes ("). The given task is to add a closed pair of HTML bold tags around a string using C++.Let us understand this with an example: Input: abc Output: abc Add Bold ... Read More

Add two numbers using ++ operator in C++.

Nishu Kumari

Nishu Kumari

Updated on 25-Jul-2025 12:41:43

865 Views

Adding two numbers is a basic arithmetic operation, where we simply combine their values to get the total. The given task is to add two numbers using the "++" operator in C++. Let's understand this with an example: Scenario 1 // Adding two numbers using '+' operator Input: a = ... Read More

Add two unsigned numbers using bits in C++.

Nishu Kumari

Nishu Kumari

Updated on 23-Jul-2025 18:12:49

735 Views

In this problem, we are given two unsigned numbers, and we need to add them using bits in C++. Bits are binary digits that can be either 0 or 1. Unsigned numbers are positive numbers represented by these bits. To add two unsigned numbers, we add their bits one by ... Read More

Program to add two binary strings in C++

Nishu Kumari

Nishu Kumari

Updated on 23-Jul-2025 18:01:13

12K+ Views

In this problem, we are given two binary strings, and we need to find their sum and return the result as a binary string. A binary string is a string that contains only the characters '0' and '1', where 0 and 1 are binary numbers. While adding two binary ... Read More

Advantages of vector over array in C++

Nishu Kumari

Nishu Kumari

Updated on 23-Jul-2025 17:42:11

413 Views

In C++, both arrays and vectors are used to store elements, but the main difference is that arrays have a fixed size and cannot be changed once initialized. Whereas, vectors are dynamic, i., e we can change their size during runtime. In this article, we'll look at the advantages ... Read More

Add Two Numbers II in C++

Nishu Kumari

Nishu Kumari

Updated on 23-Jul-2025 13:21:11

368 Views

We're given two singly linked lists, where each node stores one digit of a number. The digits are arranged from left to right, just like how we normally write numbers. For example: 7 -> 2 -> 4 -> 3 represents the number 7243. Our task is to add these two ... Read More

What is Array Decay in C++?

Nishu Kumari

Nishu Kumari

Updated on 11-Jun-2025 15:17:11

2K+ Views

The loss of type and dimensions of an array is known as array decay. It occurs when we pass the array into a function by pointer or by value. Only the address of the first element is sent, which is treated as a pointer. As a result, the original ... Read More

What is the use of cin.ignore() in C++?

Nishu Kumari

Nishu Kumari

Updated on 11-Jun-2025 15:09:43

67K+ Views

In C++, cin.ignore() is a built-in function that belongs to the istream class and is defined in the header. It is used to skip characters left in the input buffer, especially the newline character (''), which can cause issues with input operations like getline(). In this ... Read More

How to check if input is numeric in C++?

Nishu Kumari

Nishu Kumari

Updated on 30-May-2025 18:07:17

6K+ Views

Numeric input means a value that contains only digits from 0 to 9, without any letters or special characters. In this article, we'll show you how to write a C++ program to check whether the input is numeric. Let's understand this with a few examples: //Example 1: Input: 12345 ... Read More

Advertisements