Sunidhi Bansal has Published 1100 Articles

Count smaller numbers whose XOR with n produces greater value in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Aug-2020 11:30:51

71 Views

We are given an integer number let’s say, num and the task is to count the smaller numbers less than num whose XOR with num will result in a value greater than the XOR value..The truth table for XOR operation is given belowABA XOR B000101011110Input − int num = 11Output ... Read More

Count of alphabets having ASCII value less than and greater than k in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Aug-2020 11:28:41

235 Views

We are given a string of any length and the task is to calculate the count of alphabets having ASCII values less than or greater than or equals to the given integer value k.ASCII value for character A-Z are given belowABCDEFGHIJKLMNOPQRS65666768697071727374757677787980818283TUVWXYZ84858687888990ASCII value for characters a-z are given belowabcdefghijklmnopqrs979899100101102103104105106107108109110111112113114114tuvwxyz116117118119120121122Input − str ... Read More

Count of pairs from 1 to a and 1 to b whose sum is divisible by N in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Aug-2020 11:24:22

88 Views

We are given an integer array and the task is to count the total number of pairs (x, y) that can be formed using the given array values such that the integer value of x is less than y.Input − int a = 2, b = 3, n = 2Output ... Read More

Count of pairs (x, y) in an array such that x < y in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Aug-2020 11:22:15

212 Views

We are given an integer array and the task is to count the total number of pairs (x, y) that can be formed using the given array values such that the integer value of x is less than y.Input − int arr[] = { 2, 4, 3, 1 }Output − ... Read More

Count Odd and Even numbers in a range from L to R in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Aug-2020 11:19:56

327 Views

We are given a range starting from L to R of integer values and the task is to calculate the count of odd numbers and the even numbers in the range.Input − L = 7, R = 17Output − Count of Even numbers in a range from L to R ... Read More

Count pairs with Odd XOR in C++

Sunidhi Bansal

Sunidhi Bansal

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

138 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

1K+ 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

144 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

139 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

96 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

Advertisements