What is the output of this program? what is it doing? main() { int num=45; int res=find(num); printf("result is.. %d",res); } int find(int s) { if(s == 0) return 0; else return (s%10)+find(s/10); }

it prints the sum of the digits of a given number. here it prints 9 as result.

it prints the product of all the digits in a given number. it prints 20.

it prints the sum of the digits of a given number. but logic is wrong. it prints 0.

it prints the sum of the digits of a given number. but logic is wrong. it will go into infinite loop and crashes at run time.

Back To Top