Arnab Chakraborty has Published 4282 Articles

Area of a circle inscribed in a rectangle which is inscribed in a semicircle?

Arnab Chakraborty

Arnab Chakraborty

Updated on 31-Jul-2019 13:38:21

182 Views

Let us consider one semicircle is given. Its radius is R. One rectangle of length l and breadth b is inscribed in that semi-circle. Now one circle with radius r is inscribed in the rectangle. We have to find the area of the inner circle.As we know biggest rectangle that ... Read More

Arc length from given Angle?

Arnab Chakraborty

Arnab Chakraborty

Updated on 31-Jul-2019 13:33:53

206 Views

Here we will see how to get the arc length from the given angle. One circle is given. The radius of the circle is given. Our task is to get the arc length using the radius and the angle. The angle is in degree.Here r and x is given. We ... Read More

An efficient way to check whether n-th Fibonacci number is multiple of 10?

Arnab Chakraborty

Arnab Chakraborty

Updated on 31-Jul-2019 13:20:58

281 Views

Here we will see one efficient way to check whether the nth Fibonacci term is multiple of 10 or not. Suppose the Fibonacci terms are {0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987}. So here 15th (Counting from 0) Fibonacci term is ... Read More

Amazing stuff with system() in C / C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 31-Jul-2019 13:18:06

900 Views

Here we will see some amazing results by using the system() function in C or C++. The system function is present in Windows, Linux and MAC operating systems. This function is used to execute the system commands that can be written in Command line.Here we will see two usages if ... Read More

All possible strings of any length that can be formed from a given string?

Arnab Chakraborty

Arnab Chakraborty

Updated on 31-Jul-2019 13:14:53

802 Views

In this section we will see how to generate all possible strings of any length, this will take each combination of characters to make string. For example, if the string is ABC, then it will generate − {A, B, C, AB, BA, BC, CB, CA, AC, ABC, ACB, BAC, BCA, ... Read More

All possible numbers of N digits and base B without leading zeros?

Arnab Chakraborty

Arnab Chakraborty

Updated on 31-Jul-2019 13:11:26

251 Views

Here we will see one problem, We have N and base B. Our task is to count all N digit numbers of base B without any leading 0s. So if N is 2 and B is 2 there will be four numbers 00, 01, 10, 11. So only two of ... Read More

All possible co-prime distinct element pairs within a range [L, R]?

Arnab Chakraborty

Arnab Chakraborty

Updated on 31-Jul-2019 13:08:45

304 Views

Here we will see how to count number of co-prime pairs from the range, where a number will not appear more than a single pair.Before discussing the logic, let us see what are the co-prime numbers? The co-prime numbers are those numbers which has only one positive integer divisor, that ... Read More

All possible binary numbers of length n with equal sum in both halves?

Arnab Chakraborty

Arnab Chakraborty

Updated on 31-Jul-2019 13:06:08

277 Views

Here we will see all possible binary numbers of n bit (n is given by the user) where the sum of each half is same. For example, if the number is 10001 here 10 and 01 are same because their sum is same, and they are in the different halves. ... Read More

All palindrome numbers in a list?

Arnab Chakraborty

Arnab Chakraborty

Updated on 31-Jul-2019 13:00:48

352 Views

Here we will see one simple problem. We have to find all numbers that are palindrome in nature in a given list. The approach is simple, take each number from list and check it is palindrome or not, and print the number.AlgorithmgetAllPalindrome(arr, n)Begin    for each element e in arr, ... Read More

C/C++ Program to Count trailing zeroes in factorial of a number?

Arnab Chakraborty

Arnab Chakraborty

Updated on 31-Jul-2019 12:54:40

352 Views

Here we will see how to calculate the number of trailing 0s for the result of factorial of any number. So if the n = 5, then 5! = 120. There is only one trailing 0. For 20!, it will be 4 zeros as 20! = 2432902008176640000.The easiest approach is ... Read More

Advertisements