Advertisement
Guest User

Untitled

a guest
May 5th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3.  
  4. int dem(int n)
  5. {
  6.     int dem=0;
  7.     while(n!= 0)
  8.     {
  9.         n=n/10;          
  10.         dem++;
  11.     }    
  12.     return dem;
  13. }
  14.  
  15.  
  16. main()
  17. {
  18.     int n;
  19.     printf (" Nhap so nguyen n:");
  20.     scanf ("%d", &n);
  21.     printf (" Vay so chu so cua n la:%d",dem(n));
  22.     getch();
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement