Nguythang

dem so chu so

Nov 10th, 2015
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3.  main()
  4. {
  5. int i;
  6. float n;
  7. printf("Hay nhap gia tri cua n:");
  8. scanf("%f",&n);
  9. if(n<0)
  10.      n*=(-1);
  11. else if(n==0)
  12.      printf("So vua nhap co mot chu so \n");
  13. else
  14.    {
  15.      for(i=0;n>=1;i++)
  16.      n=n/10;
  17.      printf("chu so vua nhap co %d chu so",i);
  18.    }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment