Arnab Chakraborty has Published 4293 Articles

C++ program to demonstrate exception handling

Arnab Chakraborty

Arnab Chakraborty

Updated on 12-Oct-2021 06:53:43

368 Views

Suppose there is a function that calculates some serious complex mathematical operations. But during the operations, some exceptions can occur. We have to handle the different types of exceptions that can occur and perform the following.If the computer is unable to allocate the memory for computation, we have to print ... Read More

C++ program to search specific values in an array

Arnab Chakraborty

Arnab Chakraborty

Updated on 11-Oct-2021 14:36:48

4K+ Views

Suppose we are given an array 'arr' that contains n number of sorted integer values. We are also given an array 'query' of size q, and we have to tell either the values in ‘query’ are present in the given array 'arr' or not. If a value in query is ... Read More

C++ program to print values in a specified format

Arnab Chakraborty

Arnab Chakraborty

Updated on 11-Oct-2021 13:52:27

996 Views

Suppose we are given three double values. We have to format them and print them in the following format.We have to print the integer part of the first value in hexadecimal format with lowercase letters.We have to print the second value up to two decimal places, putting a sign before ... Read More

Python program to find how much money will be earned by selling shoes

Arnab Chakraborty

Arnab Chakraborty

Updated on 11-Oct-2021 12:40:03

418 Views

Suppose in a shoe shop there are n different shoe with different sizes present in an array called size and another list of pairs for m customers called demand is given, where demand[i] contains (shoe_size, money) so a customer with demand i has a demand of shoe whose size is ... Read More

Python program to find Cartesian product of two lists

Arnab Chakraborty

Arnab Chakraborty

Updated on 11-Oct-2021 12:35:53

6K+ Views

Suppose we have two list of data l1 and l2. We have to find Cartesian product of these two lists. As we know if two lists are like (a, b) and (c, d) then the Cartesian product will be {(a, c), (a, d), (b, c), (b, d)}. To do this ... Read More

Python program to print rangoli pattern using alphabets

Arnab Chakraborty

Arnab Chakraborty

Updated on 11-Oct-2021 12:26:42

5K+ Views

Suppose we have a number n. We have to create alphabet rangoli of n x n size. n must be within 1 and 26 and it will start from a and end at z when n is 26.So, if the input is like 5, then the output will be--------e-------- ------e-d-e------ ... Read More

C++ program to print values of different data types provided as input

Arnab Chakraborty

Arnab Chakraborty

Updated on 11-Oct-2021 12:07:11

2K+ Views

Suppose we are given an integer value, a long value, a character value, a float value, and a double value as inputs. We have to print the values that are given to us as input maintaining their precision.So, if the input is like integer value = 15, long value = ... Read More

C program to demonstrate usage of variable-length arrays

Arnab Chakraborty

Arnab Chakraborty

Updated on 11-Oct-2021 11:52:27

327 Views

Suppose we are in charge of building a library system that monitors and queries various operations at the library. We are now asked to implement three different commands that perform the following −By using command 1, we can record the insertion of a book with y pages at shelf x.By ... Read More

C program to find out the maximum value of AND, OR, and XOR operations that are less than a given value

Arnab Chakraborty

Arnab Chakraborty

Updated on 11-Oct-2021 11:36:58

2K+ Views

Suppose we are given two integers k and n. Our task is to perform three operations; bitwise AND, bitwise OR, and bitwise XOR between all pairs of numbers up to range n. We return the maximum value of all three operations between any two pairs of numbers that is less ... Read More

Python Program to calculate function from indicator random variable from given condition

Arnab Chakraborty

Arnab Chakraborty

Updated on 11-Oct-2021 11:22:04

325 Views

Suppose we have two values k and n. Consider a random permutation say p1, p2, ..., pn of first n natural numbers numbers 1, 2, ..., n and calculate the value F, such that F = (X2+...+Xn-1)k, where Xi is an indicator random variable, which is 1 when one of ... Read More

Advertisements