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
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
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
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
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
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
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
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
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
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