Category Archives: C++ Programs

Find the Nth Triacontakaihenagonal Number

Given a number N, the task is to find Nth triacontakaihenagonal number. A triacontakaihenagonal number is class of figurate number. It has 31 – sided polygon called triacontakaihenagon. The N-th triacontakaihenagonal number count’s the 31 number of dots and all others dots are surrounding with a common sharing corner and make a pattern. The first few triacontakaihenagonol numbers… Read More »

Check if a Number is Pentacontagon

Given an integer N, the task is to check if it is a pentacontagon number or not. Pentacontagon number is class of figurate number. It has 50 – sided polygon called pentacontagon. The N-th pentacontagon number count’s the 50 number of dots and all others dots are surrounding with a common sharing corner and make a pattern. The… Read More »

Check if a Number is Triacontakaidigon

Given an integer N, the task is to check if it is a Triacontakaidigon number or not. Triacontakaidigon number is class of figurate number. It has 32 – sided polygon called Triacontakaidigon. The N-th triacontakaidigon number count’s the 32 number of dots and all others dots are surrounding with a common sharing corner and make a pattern. The… Read More »

Check if a Number is Hexacontagon

Given an integer N, the task is to check if it is a hexacontagon number or not. Hexacontagon number is class of figurate number. It has 60 – sided polygon called hexacontagon. The N-th hexacontagon number count’s the 60 number of dots and all others dots are surrounding with a common sharing corner and make a pattern. The… Read More »

Easy Multi-Layered Calculation

Count the number of even/odd results after performing a series of calculation on a range of numbers. Given that: Each layer of calculation have two numbers (say a and b) associated with it. For each input x, y = ax + b is calculated. The result of layer i, i.e y, becomes input for layer i+1. The range… Read More »

Program to print next palindromic Time

For the given hour and minute let say “hh” and “mm” print the next sooner palindromic time. Example: Input: hh = 02 mm = 03 Output: 02:20 Explaination:For the hour 02 and minute 03 the next sooner palindromic time is 02:20 Input hh = 04 mm = 45 Output: 05:50 Explaination:For the hour 04 and minute 45 the… Read More »