{"id":9831,"date":"2023-12-28T18:12:51","date_gmt":"2023-12-28T12:42:51","guid":{"rendered":"https:\/\/www.codingbroz.com\/?p=9831"},"modified":"2024-03-25T19:17:42","modified_gmt":"2024-03-25T13:47:42","slug":"c-program-to-check-harshad-number","status":"publish","type":"post","link":"https:\/\/www.codingbroz.com\/c-program-to-check-harshad-number\/","title":{"rendered":"C Program to Check Whether a Number is a Harshad Number or Not"},"content":{"rendered":"\n

Hey folks, today you will learn how to check whether a number is a Harshad number or not in the C programming language<\/strong>.<\/p>\n\n\n\n

Let’s first know about Harshad number.<\/p>\n\n\n\n

If a number is divisible by the sum of its digits, then that number is a Harshad Number. For example, 144 is a Harshad number because 1 + 4 + 4 = 9, and 144 is divisible by 9. Some other examples of Harshad numbers are 18, 27, 54, 156, 1729, and so on.<\/p>\n\n\n\n

A Harshad number is also called a ‘Niven Number’.<\/p>\n\n\n\n

The below program prompts the user to enter a number, then it displays the message whether the entered number is a Harshad number or not.<\/p>\n\n\n\n

\n