Example-
number is: 342
then sum of square of digit is 29
program-
#include< stdio.h>
int main()
{
int n,sum=0;
printf("Enter number\n");
scanf("%d",&n);
while(n)
{
sum=sum+(n%10)*(n%10);
n=n/10;
}
printf("Sum of sqaure of digit is %d",sum);
}
Enter number
22
Sum of square of digit is 8
Enter number
34
Sum of sqaure of digit is 25