Reading hexadecimal and octal values : Hex « Data Type « C / ANSI-C






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 );
}



           
       








Related examples in the same category

1.Output float and hexadecimal
2.Read and output Signed octal
3.Output Hex