C/Data Type/Hex
Содержание
Output float and hexadecimal
#include <stdio.h>
int main(void)
{
printf("%x %#x\n", 10, 10);
printf("%*.*f", 10, 4, 1234.34);
return 0;
}
Output Hex
#include <stdio.h>
int main(void)
{
printf("\xA0 \xA1 \xA2 \xA3");
return 0;
}
Read and output Signed octal
#include <stdio.h>
int main(void)
{
int i, j;
scanf("%o%x", &i, &j);
printf("%o %x", i, j);
return 0;
}
Reading hexadecimal and octal values
#include <stdio.h>
void main()
{
int i = 10;
int j = 20;
int k = 30;
int n = 40;
n = scanf(" %d %x %o", &i , &j, &k );
printf("\n%d values read.", n);
printf("\ni = %d j = %d k = %d\n", i, j, k );
}