0
I want to write a program that displays dijits of numbers and adds dijits
765 to display dijits and add them
1 Answer
+ 8
â run a loop till n doesn't become 0
â use r=n%10 to get last digit of a number n as r. //print it.
â use sum = sum + r //for adding last digit everytime
â use n=n/10 for for removing units digit of number n.
//can do through recursion also, give it a try, if get struct U can insert the code & ask your doubt đ