Como obter int do stdio em C?

Tendo problemas significativos com isso ...

printf("> ");
int x = getchar();

printf("got the number: %d", scanf("%d", &x));
resultado
> 1234
got the number: 1