I'm writing a program that converts a binary string to a decimal value for my C programming class and I'm having a hard time filtering out non-binary strings.
I thought it was sufficient to check whether the input % 10 == 0 or == 1, but I realized that numbers like 200, 201, 300, 301, etc., fit into that category.
Can someone help? TIA