Task 1: Find the odd triangular numbers that are smaller than a number specified by the user and print them. For example, if the user chooses to print all the odd triangular numbers smaller than 50, the program should print 1, 3, 15, 21, 45. The program should keep a count of how many triangular numbers were even and how many of them were odd up to the maximum given by the user and print this information too
Task 2: Find the numbers that can be written as the product of two nonnegative odd integers in succession and print them in increasing order. For each number found the program should check whether the number is a factor of a number chosen by the user and indicate this in the output. (For example, 35 is such a number as it can be written as the product of 5 and 7 (35=5x7), which are two odd numbers in succession). The user should specify how many such numbers they want to print, starting from a minimum value.
31st Jan 2023
Commercial International Bank (CIB) Egypt has announced the full acquisition of Mayfair CIB Bank Limited in Kenya. The Central Bank of Kenya (CBK) has gran
14th Nov 2022
HOW TO SETUP LIPA NA M-PESA ONLINE API LIPA NA M-PESA PAYMENT INTERGRATION Mpesa is a mobile money payment service by Safaricom based in Kenya. It was re
10th Nov 2022
The Teachers Service Commission (TSC) of Kenya is an Independent Commission established under the Constitution of Kenya to manage human resource within the
Comments (0)
Leave a Comment