{"id":5316,"date":"2022-01-22T23:00:00","date_gmt":"2022-01-22T17:30:00","guid":{"rendered":"https:\/\/www.codingbroz.com\/?p=5316"},"modified":"2022-01-22T21:14:35","modified_gmt":"2022-01-22T15:44:35","slug":"c-program-to-calculate-generic-root-of-a-number","status":"publish","type":"post","link":"https:\/\/www.codingbroz.com\/c-program-to-calculate-generic-root-of-a-number\/","title":{"rendered":"C Program to Calculate Generic Root of a Number"},"content":{"rendered":"\n

In this post, we will learn how to calculate the generic root of a number using C<\/strong> Programming language. But before that let\u2019s learn about the generic root of a number<\/strong>.<\/p>\n\n\n\n

Generic root<\/strong> of a number is the sum of all the digits of a given number until we get a single digit output. For example, if a number is 428<\/strong>, then it\u2019s generic root will be 4 + 2 + 8 = 14<\/strong>, then 1 + 4 = 5<\/strong>.<\/p>\n\n\n\n

The below program asks the user to enter a number, then it calculates the generic root of the entered number using the following approaches.<\/p>\n\n\n\n

  1. Using Loops<\/li>
  2. Using Functions<\/li><\/ol>\n\n\n\n

    So, without further ado, let\u2019s begin this tutorial.<\/p>\n\n\n\n

    \n