- /* ************************* */
- /* Vanderbruggen Thomas, 2003 */
- /* ************************* */
-
- #include <stdio.h>
-
- int nombre, base, quotient[250], i, j, reste[250];
-
- int main(void)
- {
- while(1)
- {
- printf("\nEntrer nombre :");
- scanf("%u", &nombre);
-
- while(1)
- {
- printf("Entrer base :");
- scanf("%u", &base);
-
- if(base != 0) break;
- else printf("Votre base ne pas être nulle");
- }
-
- quotient[0] = nombre/base;
- reste[0] = nombre%base;
-
- i = 0;
-
- while(quotient[i] >= 1)
- {
- i++;
- quotient[i] = quotient[i-1]/base;
- reste[i] = quotient[i-1]%base;
- }
-
- j = i;
-
- while(j != -1)
- {
- printf("%u", reste[j]);
- j--;
- }
- }
- return 0;
- }
/* ************************* */
/* Vanderbruggen Thomas, 2003 */
/* ************************* */
#include <stdio.h>
int nombre, base, quotient[250], i, j, reste[250];
int main(void)
{
while(1)
{
printf("\nEntrer nombre :");
scanf("%u", &nombre);
while(1)
{
printf("Entrer base :");
scanf("%u", &base);
if(base != 0) break;
else printf("Votre base ne pas être nulle");
}
quotient[0] = nombre/base;
reste[0] = nombre%base;
i = 0;
while(quotient[i] >= 1)
{
i++;
quotient[i] = quotient[i-1]/base;
reste[i] = quotient[i-1]%base;
}
j = i;
while(j != -1)
{
printf("%u", reste[j]);
j--;
}
}
return 0;
}