how to store a 6 digit number as 6 separate integers
int number; // = some int
while (number > 0) {
print( number % 10);
number = number / 10;
}
how to store a 6 digit number as 6 separate integers
int number; // = some int
while (number > 0) {
print( number % 10);
number = number / 10;
}
how to get each digit of a number
sumOfDigit(n):
sum = 0
temp = 0
while n >= 1:
# temmp % 10 to get the rightmost digit
temp = n % 10
sum += temp
# n // 10 to get the the rest of digit except rightmost digit (198 // 10 = 19)
n //= 10
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us