Sunidhi Bansal has Published 1085 Articles

Count pairs with Odd XOR in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Aug-2020 09:48:14

211 Views

We are given an integer array and the task is to count the total number of pairs that can be formed using the given array values such that the XOR operation on the pairs will result in an ODD value.The truth table for XOR operation is given belowABA XOR B000101011110Input ... Read More

Count pairs with given sum in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Aug-2020 09:45:01

2K+ Views

We are given an integer array and the task is to count the total number of pairs that can be formed using the given array values such that the sum of the pairs is equal to the given sum.Input − int arr[] = {2, 8, 1, 5, 11}, sum = ... Read More

Count pairs with Bitwise XOR as ODD number in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Aug-2020 09:41:31

227 Views

We are given an integer array and the task is to count the total number of pairs that can be formed using the given array values such that the XOR operation on the pairs will result in an ODD value.The truth table for XOR operation is given belowABA XOR B000101011110Input ... Read More

Count pairs with Bitwise XOR as EVEN number in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Aug-2020 09:39:18

223 Views

We are given an integer array and the task is to count the total number of pairs that can be formed using the given array values such that the XOR operation on the pairs will result in an EVEN value.The truth table for XOR operation is given belowABA XOR B000101011110Input ... Read More

Count pairs with Bitwise OR as Even number in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Aug-2020 09:19:14

171 Views

We are given an integer array and the task is to count the total number of pairs that can be formed using the given array values such that the OR operation on the pairs will result in an even number.The truth table for OR operation is given belowABAVB000101011111Input − int ... Read More

Count pairs with Bitwise-AND as even number in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Aug-2020 09:15:58

172 Views

We are given an integer array and the task is to count the total number of pairs that can be formed using the given array values such that the AND operation on the pairs will result in an even number.The truth table for AND operation is given belowABA^B000100010111Input − int ... Read More

Count pairs with Bitwise AND as ODD number in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Aug-2020 09:12:59

159 Views

We are given an integer array and the task is to count the total number of pairs that can be formed using the given array values such that the AND operation on the pairs will result in an odd number.The truth table for AND operation is given belowABA^B000100010111Input − int ... Read More

Count of parallelograms in a plane in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Aug-2020 09:08:00

185 Views

We are given a plane containing points forming the parallelogram and the task is to calculate the count of parallelograms that can be formed using the given points. In parallelograms opposite sides of a quadrilateral are parallel and therefore opposite angles are equal.Input −int a[] = {0, 2, 5, 5, ... Read More

Count set bits in a range in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Aug-2020 09:03:11

356 Views

We are given an integer number let’s say, num and the range with left and right values. The task is to firstly calculate the binary digit of a number and then set the loop from the left digit till the right digit and then in the given range calculate the ... Read More

Count total bits in a number in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Aug-2020 08:58:20

5K+ Views

We are given an integer number let’s say, num and the task is to firstly calculate the binary digit of a number and calculate the total digits of a number.Input − int number = 50Output − Count of total bits in a number are − 6Explanation − Binary representation of ... Read More

Advertisements