Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Napisz program, w którym zdefiniujesz funkcję rekurencyjną konwertującą zapis dziesiętny liczby naturalnej większej od zera na zapis ósemkowy.
- */
- #include <stdio.h>
- void convert_to_octal(unsigned long int number)
- {
- if(number){
- convert_to_octal(number/8);
- printf("%lu", number%8);
- }
- }
- int main(void)
- {
- convert_to_octal(100);
- printf("\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment