VALID PERFECT SQUARE

Description:

Get a positive integer. Let N be the number of test cases.Check the number whether perfect square or not.Print TRUE when the integer is perfect square.If it is not, return FALSE.Describe it without using built-in-function.Input format: The input is verified whether the number is perfect square or not. Output format: Whether the input is perfect square then true is returned, else it should return false. EXPLANATION: Get a non-negative integer from the user. Check it whether it is perfect square or not by using arithmetic functions. Print True when it is valid perfect square integer. If the integer is not valid perfect square integer, then print False. Note: Do not use any inbuilt function. Test Case 1 Input (stdin) 34 Expected Output FALSE Test Case 2 Input (stdin) 121 Expected Output TRUE

Program :

#include <stdio.h>


int main()

{

    int a, n;

    scanf("%d", &n);

    for(a = 0; a <= n; a++)

    {

        if (n == a * a)

        {

            printf("TRUE");

            return 0;

        }

    }

    printf("FALSE");

    return 0;

}