0

Can Anybody Have Power to solve the Answer In C

You Have to Print all the No's from 1 to n but the perfect cube should not be printed like (2,8,27 etc) should Not Be printed like (1,3,4,5,6,7,9.......n).

15th Jan 2018, 5:10 PM
Atulpg7
Atulpg7 - avatar
4 ответов
+ 2
2 is not a cube, 1 is. There are two ways: 1. Make an int (something) equal 1, it will be used to check if a No is a cube, you need a loop (for will be best), make inside if-else statement, if No == that (something)^3 just increese (something) by 1, else print No 2. The same, but in if you check, if No == cbrt(No)^3, No needs to be int
15th Jan 2018, 5:51 PM
rafal
+ 2
Most here will not give programs without effort on your part. Code your best guess at it based on @rafal post. Post it here. We will help fix it.
16th Jan 2018, 6:41 PM
John Wells
John Wells - avatar
0
for(i=1;i<n;i++) { if (cbrt(i) ==0) continue; printf(i); }
15th Jan 2018, 5:37 PM
Krishnatheja Vanka
Krishnatheja Vanka - avatar
0
give me full programe please bcz it would nit work...
16th Jan 2018, 5:43 AM
Atulpg7
Atulpg7 - avatar