Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int suma(int vlez)
- {
- if(vlez < 100)
- return vlez;
- else {
- return vlez % 100 + suma(vlez/10);
- }
- }
- int main()
- {
- int br;
- scanf("%d", &br);
- printf("%d", suma(br));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement