This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void print_array(int array[], int n) | |
{ | |
int i; | |
for (i = 0; i < n; i++) { | |
printf("%d%s", array[i], i != n-1 ? " " : "\n"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* put the base b representation of n into s: 0 is represented by "" */ | |
void | |
numbconv(char *s, int n, int b) | |
{ | |
int len; | |
if (n == 0) { | |
strcpy(s, ""); | |
return; |