Computer Science, asked by pippogaming6, 2 days ago

a number is said to be multiple harshad number when divided by the sum of it's digits produces another harshad number. write a program and variable descriptions​

Answers

Answered by priyanshu1159
6

Answer:

Write a program to input a number and check whether it is 'Magic Number' or not. Display the message accordingly.

A number is said to be a magic number if the eventual sum of digits of the number is one.

Sample Input : 55

Then, 5 + 5 = 10, 1 + 0 = 1

Sample Output: Hence, 55 is a Magic Number.

Similarly, 289 is a Magic Number.

Explanation:

please drop some thanks for me please

and make me as brainlist please

Answered by prachihooda7
0

Explanation:

num = 156;

rem = sum = 0;

#Make a copy of num and store it in variable n

n = num;

#Calculates sum of digits

while(num > 0):

rem = num%10;

sum = sum + rem;

num = num//10;

#Checks whether the number is divisible by the sum of digits

if(n%sum == 0):

print(str(n) + " is a harshad number");

else:

print(str(n) + " is not a harshad number");

plz Mark as brainliest

Similar questions