can't figure out what I'm doing wrong....Im trying to write a program that can convert a sequence of positive integers from base-10 (decimal) to base-2 (binary), but I can't use the pow function
#include <stdio.h>
#include <stdlib.h>
void input_check (int start, int stop)
{
if (( 0 <= start) && (start <= stop) && (stop <= 255))
return;
else
exit(1);
}
int powerup (int m, int h)
{
int z = m;
int i = 0;
if (h == 0)
return 1;
for (i = 1; i < h; i++)
{
z = z * m;
}
return z;
}
void convert (int y)
{
int i;
int check, conver;
for (i = 7; i >= 0; i--)
{
check = conver(2, i)
if (y >= check)
{
printf("1");
y = y - check;
}
else
printf("0");
}
return;
}
int main(void)
{
int start = 0;
int stop = 0;
int t = 0;
printf(" Please enter a start number: ");
scanf(%d, &start);
printf(" Please enter a stop number: ");
scanf(%d, &stop);
{
input_check (start, stop);
for(t = start; t <= stop; t++)
{
printf("%d ", t);
convert ( t);
printf("\n");
}
}
}