#include <iostream.h>
main()
{
int num , temp , sum = 0 ;
cout<<"Enter an integer value :\n";
cin>>num;
do
{
temp = num % 10 ;
sum = sum + temp ;
num = num / 10 ;
}
while (num != 0) ;
cout<<"The sum of individual digits is "<<sum;
}
Labels: C++ Basic Codes, C++ Codes
Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies| |
---|
0 comments:
Post a Comment