answersLogoWhite

0

(I'm assuming base 10 math) You could cheat. Convert the number to a string with no leading zeros. Capture the left most and right most characters of the string. Convert captured string variables back to integers. Add the integers. (Note: Consider a base string having a string length of 0 or 1.)

User Avatar

Wiki User

18y ago

What else can I help you with?

Continue Learning about Engineering

Write a pseudo code to find the sum of digits of a given number reducing them to a single digit?

5


Sum of the digits of a number equals the number.Generate such numbers?

It appears that only single digit numbers work (0 thru 9)


What is strong number in java script?

In JavaScript, a "strong number" (or "Armstrong number") for a given number of digits is a number that is equal to the sum of its own digits each raised to the power of the number of digits. For example, 153 is a strong number because it has three digits, and (1^3 + 5^3 + 3^3 = 153). To determine if a number is a strong number, you can convert it to a string to access each digit, calculate the sum of the digits raised to the appropriate power, and then compare it to the original number.


Individual digits sum with flowchart and algorithm?

Well, it's very hard to write a flowchart in text, so I'll give you some pseudo code instead. int number = the given number int sum = 0 loop while number is not 0 sum = sum + (number mod 10) number = number / 10


How do you write a program in qbasic to input 64751315 to sum?

In QBASIC, you can write a simple program to input the number 64751315 and sum its digits as follows: DIM sum AS INTEGER sum = 0 INPUT "Enter a number: "; number FOR i = 1 TO LEN(number) sum = sum + VAL(MID$(number, i, 1)) NEXT PRINT "The sum of the digits is "; sum This program prompts the user to input a number, iterates through each digit, converts it to an integer, and adds it to the total sum, which is then printed out.