#include <stdio.h>
int main() {
int a, b;
scanf("%d %d", &a, &b);
if (a == b)
printf("equal");
}
so I input the number with 001 and 1, but they are equal. I want that they be considered unequal. Is there any possibility to do that and how?
scanf("%d")discards all leading zeros, so you won't be able to compare theintsproperly. In general, anintis just a number and doesn't store anything like leading zeros. To keep leading zeros, you need to read and compare strings withstrcmp: