Advertisement
Cieslin

PPIleCyfr

Nov 21st, 2017
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <conio.h>
  3.  
  4.  
  5. int main()
  6. {
  7.     int liczba = 0, tmp, count = 0;
  8.     while (true)
  9.     {
  10.         printf("Podaj liczbe: ");
  11.         scanf("%d", &liczba);
  12.         tmp = liczba;
  13.         while (tmp / 10 > 0)
  14.         {
  15.             tmp = tmp / 10;
  16.             count++;
  17.         }
  18.         printf("Ilosc cyfr w liczbie: %d\n", count + 1);
  19.         count = 0;
  20.     }
  21.     _getch();
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement