Tech Number

Tech Number is an even digit number which when divided into two equal parts and then square of the sum of those two parts are equal to the original number.

Example 1: 2025. 20+25 = 45. 452 = 2025. Hence it is a Tech Number.

Example 2: 3012. 30+12 = 42. 422 ≠ 3012. Here the square of the sum of the two parts is not equal to the original number. Hence it is not a Tech Number.

C
#include <stdio.h>
#include <math.h>
int main() 
{
    int n=0,s=0,cnt=0,nCopy=0,left=0,right=0;
    printf("Enter a number: ");
    scanf("%d",&n);
    nCopy=n;
    while(n>0)
    {
        cnt++;
        n=n/10;
    }
    n=nCopy;
    if(cnt%2==0)
    {
        left=n/(int)pow(10,cnt/2);
        right=n%(int)pow(10,cnt/2);
        s=left+right;
        if((s*s)==nCopy)
        {
            printf("%d is a Tech Number",nCopy);
        }
        else
        {
            printf("%d is not a Tech Number",nCopy);
        }
        }
    else
    {
        printf("%d is not a Tech Number",nCopy);
    }
    return 0;
}
C