The ones who are crazy enough to think they can change the world are the ones who do.
- Steve Jobs

C Perfect Cube

What Is Perfect Cube?

When a number is multiplying three times by itself then the product is said to be perfect cube.

C Program to find the perfect cube upto 100

Let us write a C program to extract all perfect cube number upto 100.

c-perfect-cube.c
#include <stdio.h>
int main()
{
int a = 1;
while( a * a * a < 100)
{
printf("%4d ", a * a * a);
a++;
}
return 0;
}
1  8  27  64

Note:

Above program looks straight forward. Multiply a number three times by itself and check the resultant value is no more greater than 100. If the condition satisfied, print the number else exit the program.

Did You Know?

Every number has a perfect cube number, but every number is not a perfect cube number.

Report Us

We may make mistakes(spelling, program bug, typing mistake and etc.), So we have this container to collect mistakes. We highly respect your findings.

Report