Arnab Chakraborty has Published 4452 Articles

C++ program to demonstrate multi-level inheritance

Arnab Chakraborty

Arnab Chakraborty

Updated on 12-Oct-2021 06:21:59

11K+ Views

Suppose we have three classes Vehicle, FourWheeler, and Car. The class Vehicle is the base class, the class FourWheeler is derived from it and the class Car is derived from the class FourWheeler. Class Vehicle has a method 'vehicle' that prints 'I am a vehicle', class FourWheeler has a method ... Read More

C++ program to search specific values in an array

Arnab Chakraborty

Arnab Chakraborty

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

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

764 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

293 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

5K+ 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 capitalize each word's first letter

Arnab Chakraborty

Arnab Chakraborty

Updated on 11-Oct-2021 12:34:20

1K+ Views

Suppose we have a sentence with English lowercase letters. We have to convert first letter of each word into uppercase.So, if the input is like s = "i love my country", then the output will be "I Love My Country"To solve this, we will follow these steps −words := list ... Read More

Python program to print rangoli pattern using alphabets

Arnab Chakraborty

Arnab Chakraborty

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

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

208 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

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

Advertisements