Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Write a C program to find whether a given number is a smith number or not

0 votes
asked Oct 28, 2022 by Tanveer Singh (260 points)

Aparna was a high school math teacher. She has a practice to knowledge share 10 minutes after
her lectures in all the classes she mentor. She updates a new concept to her students every day and
asks them to work out on it too. She prepared a session on Smith number to students for the next
day. Smith number is a number for which the sum of its digits is equal to the sum of the digits of
its prime factors. She illustrated them with few examples and now wanted her students to work out
on few numbers to check if it was a smith number. Let us help her write a C program so that she
could verify if her students got it right.
Input Format:
Input consists of an integer value.
Output Format:
Output specifies if the number got was a smith number or not.
Refer Sample Input and Output.
[All text in bold corresponds to input and the rest corresponds to output]
Sample Input and Output:
Enter a number: 85
85 is a Smith number.
Enter a number: 101
101 is not a Smith number.

1 Answer

0 votes
answered Oct 28, 2022 by Peter Minarik (84,720 points)
Please, share your solution and ask specific questions and people will be more than happy to help you fix or optimize your code.

Please, do not ask others to solve your school assignment for you.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...