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 any professors including name, age and city from the entrance.
Write a program that receives a number from the input and increases the number 2 and prints in the output. This trend continues until the number 0 is not arrived
Write a program that receives 2 users and calculates the Fibonacci series (between those two) and prints in the output
Write a program that receives a text and a word from the user, search the word in the text, and as the example below and then put the word * and print the text in the output. Example: Input1: Hello. My name is hooshang. I ...
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام 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.