Hey guys, I am in the middle of writing a program (in "C") to help me convert Decimal numbers to Binary numbers but I need some help. I wrote the program but I know it isn't right, so I was wondering if I can post it here and maybe you guys can help me out. Here it is:
Thank you for you help,
Code:
[B]#include <stdio.h>
int main()
{
int a, b, c;
printf("Enter the variable:");
scanf("%d", &a);
b = a / 2;
if b < 2
{
c = b /2;
}
printf("%d", "%d", b, c);
}[/B]