Write an iterative function char* conversion(unsigned int num, int base),
that converts an integer num into any base (base <=10).
How to transform the following recursive function conversion() into iterative:
#include <stdio.h>
void conversion(unsigned num, unsigned base)
{
if (num / base)
conversion(num / base, base);
printf("%u", num % base);
}
int main()
{
unsigned num, base;
printf("num=");
scanf("%u", &num);
do{
printf("base=");
scanf("%u", &base);
}
while (base < 2 || base > 10);
conversion(num, base);
return 0;
}