The sum of the figures of the number
Write a program that receives a number from the user and prints the sum of its figures in the output
Write a program that receives a number from the user and prints the sum of its figures in the output
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
const num = prompt("Enter number"); let sum = 0; for (let number of num) { sum += parseInt(number); } console.log(sum);
total=0 a=int(input('num:')) for i in str(a): total += int(i) print(total)
def sum_of_numbers(i): while 1: a=int(input('num:')) if a==0: break i+=a print(i) d=int(input('num:')) print(sum_of_numbers(d))
num=int(input("num: ")) x=0 while num>0: digit=num%10 x+=digit num=num//10 print(f"total: {x}")
# sum of digits Num = int(input("Give me a number: ")) sum = 0 while Num != 0 : Num1 = int(Num % 10) Num = int(Num / 10 ) sum = sum + Num1 print(f"The sum of digits is: {sum}")
a=int(input("num:")) b=int(input("num:")) print(a+b)
num = input("enter your number:") a = 0 for i in num: a = a + int(i) else: print(a)
It was great
Submitting answers is currently unavailable.
Write a program that receives a rectangular length and width from the input and prints its area in the output
We want to open a cow door, we don't know the safety password, but we have the following information: the second -digit safing password is the first number of the first digit, the last 4th of the person in one unit is smaller than their first digit ...
Write a program that receives 2 numbers from the input and prints the larger number
Write a function that receives a username and if it was a character except the lowercase English letters, FALSE and otherwise TRUE
You must be logged in to access this section.
Login/Sign up If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.