Advertisement
BartekCK

Untitled

Mar 17th, 2018
96
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 <stdlib.h>
  3.  
  4. void convert_to_oct(int number)
  5. {
  6.     if(number) {
  7.         convert_to_oct(number/8);
  8.         printf("%d",number%8);
  9.     }
  10. }
  11.  
  12.  
  13. int main()
  14. {
  15.     int liczba;
  16.     printf("Podaj liczbe\n");
  17.     scanf("%d", &liczba);
  18.     convert_to_oct(liczba);
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement