Advertisement
luizaspan

Número de dígitos

May 26th, 2015
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.18 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.   int n,i,y;
  6.  
  7.   n=15234;
  8.   y=1;
  9.  
  10.   while (n>=10)
  11.     {
  12.       n=n/10;
  13.       y++;
  14.     }
  15.  
  16.   printf("%d dígitos \n",y);
  17.  
  18.   return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement