Files
c-course/c-basic/hex_read_scanf.c
Mert Gör 79f83aa190 int main() {
unsigned int a; // Change 'int' to 'unsigned int'

    printf("Enter your number: ");
    scanf("%x", &a); // Now 'a' matches '%x' expected type
    printf("a = %u\n", a); // Use '%u' to correctly print an unsigned int

    return 0;
}
2025-04-12 22:09:27 +03:00

12 lines
273 B
C

#include <stdio.h>
int main() {
unsigned int a; // Change 'int' to 'unsigned int'
printf("Enter your number: ");
scanf("%x", &a); // Now 'a' matches '%x' expected type
printf("a = %u\n", a); // Use '%u' to correctly print an unsigned int
return 0;
}