Choose Category
//SUM OF DIGITS IN THE GIVEN NUMBER #include<iostream.h> #include<conio.h> void main() { int n,sum=0,a; clrscr(); cout<<"Enter the number:"; cin>>n; while(n != 0) { a=n % 10; sum=sum + a; n=n/10; } cout<<"Sum of the digits of given number is:"<<sum; getch(); }