/***************************************************************************** * Outputs the sum of the digits of a three digit number. * * Written: December 7, 2001 * * By: Ronald Roberts * *****************************************************************************/ //Ronald Roberts //7DEC01 //Program 56 #include #include int calresults(int num); int main() { int num=100; while((num>=100 && num<1000) || (num<=-100 && num>-1000)) { cout<<"Enter any 3-digit number (<100 or >999 to exit): "; cin>>num; cout<<"Sum of the digits: "<999 to exit): 127 Sum of the digits: 10 Enter any 3-digit number (<100 or >999 to exit): 310 Sum of the digits: 4 Enter any 3-digit number (<100 or >999 to exit): 311 Sum of the digits: 5 Enter any 3-digit number (<100 or >999 to exit): 999 Sum of the digits: 27 Enter any 3-digit number (<100 or >999 to exit): -125 Sum of the digits: -8 Enter any 3-digit number (<100 or >999 to exit): -999 Sum of the digits: -27 Enter any 3-digit number (<100 or >999 to exit): 99 Sum of the digits: 18 Goodbye. */