You are on page 1of 1

#include<iostream.h> #include<conio.

h> void main() { int x,sum,num,y; cout<<"\n Enter the number : "; cin>>num; sum=0; while(num>0) { x=num%10; y=x; sum=sum+y; num=num/10; } cout<<"\n sum of squares of digits of number is " <<sum; getch(); }