tag:blogger.com,1999:blog-959939550345671470.post3536960406757942152..comments2024-03-17T12:50:37.677+05:30Comments on C programming Interview questions and answers: FIND SUM OF DIGITS OF A NUMBER USING RECURSION USING C PROGRAMPriyanka kumarihttp://www.blogger.com/profile/08145649011863585828noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-959939550345671470.post-77125295807916768202015-03-22T09:26:20.971+05:302015-03-22T09:26:20.971+05:30its global variable
its initialize with 0 by defa...its global variable <br />its initialize with 0 by default Anonymoushttps://www.blogger.com/profile/05962398332467327559noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-80027510685633668572015-01-26T15:12:57.562+05:302015-01-26T15:12:57.562+05:30int sum = 0;
if (num < 10)
return num;
else...int sum = 0;<br /> if (num < 10)<br /> return num;<br /> else<br /> {<br /> sum = num % 10;<br /> num = num / 10;<br /> num = num + sum;<br /> return Add_Digits(num);<br /> }Gokulnath Nhttps://www.blogger.com/profile/08011562122085965571noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-44738261373713925072014-02-28T12:30:45.371+05:302014-02-28T12:30:45.371+05:30how will you find the sum of the digits of the res...how will you find the sum of the digits of the resulting sum of digits if it is more than 10?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-56350629988872335502013-12-07T04:16:55.075+05:302013-12-07T04:16:55.075+05:30what's the meaning of if (n) ??what's the meaning of if (n) ??Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-7888946810070905322013-11-23T16:51:52.733+05:302013-11-23T16:51:52.733+05:30The variable s treats as a external variable.the d...The variable s treats as a external variable.the default value of s is automatically initialized to 0.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-44928181896794710642013-08-14T11:21:25.599+05:302013-08-14T11:21:25.599+05:30ya u r right...ya u r right...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-15857075307482230182013-08-14T11:20:26.451+05:302013-08-14T11:20:26.451+05:30initialize with zeroinitialize with zeroAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-39237253044327111992013-06-22T00:37:02.433+05:302013-06-22T00:37:02.433+05:30No need as it is global so already initialized wit...No need as it is global so already initialized with 0.dgdinkarhttps://www.blogger.com/profile/04363350753737434290noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-73743851493418606192013-06-22T00:27:33.897+05:302013-06-22T00:27:33.897+05:30This comment has been removed by the author.dgdinkarhttps://www.blogger.com/profile/04363350753737434290noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-76308051976144642712013-06-18T08:48:17.827+05:302013-06-18T08:48:17.827+05:30s should be initialized with 0s should be initialized with 0Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-26380022794406875272013-06-09T16:41:41.885+05:302013-06-09T16:41:41.885+05:30You should declare function int findsum(int) and l...You should declare function int findsum(int) and line 18 (else) shouldn't be included, because the output is incorrect...here is the right source code:<br /><br />#include<br />int findsum(int);<br />int main(){<br /> int num,x;<br /><br /> printf("\nEnter a number: ");<br /> scanf("%d",&num);<br /> x=findsum(num);<br /> printf("Sum of the digits of %d is: %dCProgrammerhttps://www.blogger.com/profile/01361046419925259770noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-42359124204812064522012-09-25T16:28:12.478+05:302012-09-25T16:28:12.478+05:30write a program to add the following
¼+2/4+3/4+5/...write a program to add the following<br /> ¼+2/4+3/4+5/3+6/3+………<br />Anonymoushttps://www.blogger.com/profile/18055140913425797692noreply@blogger.com