C Perfect Square

What Is Perfect Square?

When a number is product by itself, then a resultant value is said to be a perfect square
perfect square

C Program - To Find the Perfect Square upto 100

Let us write a C program to extract all perfect square number upto 100.
c-perfect-square.c
#include <stdio.h>
int main()
{
int a = 1;
while(a * a < 100)
{
printf("%4d", a * a);
a++;
}
return 0;
}
1  4  9  16  25  36  49  64  81

Note:

Above program looks straight forward. Multiply a number 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 square number, but every number is not a perfect square number.