diff --git a/c-basic/scanf-hex.c b/c-basic/scanf-hex.c new file mode 100644 index 0000000..7226b52 --- /dev/null +++ b/c-basic/scanf-hex.c @@ -0,0 +1,22 @@ +/** + * @file scanf-hex.c + * @author Mert Gör (mertgor@masscollabs.xyz) + * @brief Scanf accepts the int variable as hex if we pass %x + * @version 0.1 + * @date 2024-01-24 + * + * @copyright Copyright (c) 2024 Mert Gör and contributors - GPLv3 or any later + * + */ + +#include + +int main(){ + int a; + int b; + printf("enter a number : "); + scanf("%x", &a); + printf("a = %d\n", a); + + return 0; +} \ No newline at end of file