Member • Aug 29, 2013
C++ program to calculate sum of numbers entered in real time
like
Number 12345 sum of last three digits is 12.
but what should be done if the compiler has to sum all the digits of that number depending on run time input of the number.
like user enters 1234567890 0r 12345678 or 12345678 then how can compiler choose the function to calculate the digits sum at run time, using sizeof() operator for input number and then placing the condition seems useless because all the digits use 4 byte of int except for the number 1234567890 ,then how can we make condition on the run time?????