fillpoly() function in C

Arnab Chakraborty
Published on 23-Jul-2020 11:47:53
ConceptNow the header file graphics.h contains fillpoly() function which is implemented to draw and fill a polygon such as triangle, rectangle, pentagon, hexagon etc. So this function require same arguments as drawpoly().Syntaxvoid fillpoly( int number, int *polypoints );In this case, number indicates (n + 1) number of points where, n ... Read More

Fill 8 numbers in grid with given conditions in C++

Arnab Chakraborty
Published on 23-Jul-2020 11:41:40
ConceptWe have to place the numbers 2, 3, 4, 5, 6, 7, 8, 9 into the eight circles in the figure given below, in this way that no number is adjacent to a number that is next to it in thesequence.Example For example, 2 should not be adjacent to 3 but ... Read More

Check if a number is Primorial Prime or not in C++

Arnab Chakraborty
Published on 23-Jul-2020 11:35:54
ConceptWith respect of given positive number n, the task is to verify if n is a primorial prime number or not. We have to print ‘YES’ if n is a primorial prime number otherwise print ‘NO.Primorial Prime − With respect of Mathematics, a Primorial prime is defined as a prime ... Read More

Check if a number is an Achilles number or not in C++

Arnab Chakraborty
Published on 23-Jul-2020 11:33:34
ConceptWith respect of given positive integer n, the task is to verify if n is an Achilles number or not. We have to print 'YES' if N is treated as an Achilles number else print 'NO'.Achilles number: With respect of Mathematics, an Achilles number is defined as a number that ... Read More

Check if a number is a Trojan Numbers in C++

Arnab Chakraborty
Published on 23-Jul-2020 11:29:17
ConceptWith respect of given number n, the task is to verify whether n is a Trojan Number or not. Trojan Number is defined as a number that is a strong number without a perfect power. We can say that a number n is treated as a strong number if, for ... Read More

Check if a line at 45 degree can divide the plane into two equal weight parts in C++

Arnab Chakraborty
Published on 23-Jul-2020 11:26:35
ConceptWith respect of a given set of n points (XI, YI) in 2D coordinate and each point's weight WI, the task is to verify whether a line at 45 degree can be drawn. So it should be noted that sum of weights of points on each side are equal.Input X1 = ... Read More

Check if a king can move a valid move or not when N nights are there in a modified chessboard in C++

Arnab Chakraborty
Published on 23-Jul-2020 11:23:46
ConceptWith respect of given infinite chessboard with the same rules as that of chess and given N knights coordinates on the infinite chessboard (-10^9 <= x, y <= 10^9) and the king’s coordinate, the task is to verify if the King is checkmate or not.Input a1[] = { { 2, 1 ... Read More

Check if a key is present in every segment of size k in an array in C++

Arnab Chakraborty
Published on 23-Jul-2020 11:21:26
ConceptWith respect of a given array arr1[] with size of array N, one another key X and a segment size K, the task is to determine that the key X present in every segment of size K in arr1[].Input arr1[] = { 4, 6, 3, 5, 10, 4, 2, 8, 4, ... Read More

Check if a given string is a valid number in C++

Arnab Chakraborty
Published on 23-Jul-2020 11:19:23
ConceptIt should be validated if a given string is numeric.Input − str = "12.5"Output − trueInput − str = "def"Output − falseInput − str = "2e5"Output − trueInput − 10e4.4Output − falseMethodWe have to handle the following cases in the code.We have to ignore the leading and trailing white spaces.We ... Read More

Check if a given graph is Bipartite using DFS in C++ program

Arnab Chakraborty
Published on 23-Jul-2020 11:16:53
ConceptWith respect of a given connected graph, verify if the graph is bipartite or not. With respect of possibility of a bipartite graph, if the graph coloring is possible applying two colors such that vertices in a set are colored with the same color. It should be noted that it ... Read More
1 2 3 4 5 6 7 ... 3733 Next
Advertisements