Advertisement
TwiNNeR

Да се напише рекурзивна функција која за даден број ќе пресм

Oct 26th, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.25 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int brcifri(int x)
  5. {
  6.     if(x==0) return 0;
  7.     return 1+brcifri(x/10);
  8. }
  9.  
  10. int main()
  11. {
  12.     int daden;
  13.     scanf("%d",&daden);
  14.     printf("brojot ima %d cifri\n",brcifri(daden));
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement