1.

To complete the following program to find numbers whose cube is less than 1000 which ofthe following options would be the correct one?N = 1cube_of_N = N*N*NWhile cube_of_N< 1000if _________ thenPrint NN = N + 1cube_of_N = N*N*Nend ifEnd while(a) N < 1000(b) N < N + 1(c) N > 1(d) N > 1000no irrelevant answers plzz​

Answer»

ANSWER:

Numbers LESS than N that are perfect cubes and the sum of their digits reduced to a single digit is 1

Given a NUMBER n, the task is to print all the numbers less than or equal to n which are perfect cubes as well as the eventual sum of their digits is 1.

Examples:

INPUT: n = 100

Output: 1 64

64 = 6 + 4 = 10 = 1 + 0 = 1

Input: n = 1000

Output: 1 64 343 1000



Discussion

No Comment Found