fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. #define cyfry(x, y) y = ceil(log10(x))
  5.  
  6. int main(void) {
  7. int x=123, y;
  8. cyfry(x,y);
  9. printf("Liczba %d posiada %d cyfr\n",x,y);
  10. return 0;
  11. }
  12.  
Success #stdin #stdout 0s 2160KB
stdin
Standard input is empty
stdout
Liczba 123 posiada 3 cyfr