Show Integer to Hexadecimal,Octal, and Where it's Memory Location.

Thursday, October 8, 2009

This is just want to show You the reader, how to show integer to hexadecimal and octal. And also show the memory location.

/* menampilkan desimal dan heksadesimal */

int main(void){
    int X;

    printf("Please insert integer number: ");
    scanf("%d", &X);

    printf("%d is %#x in hexadecimal and %o in octal.\n", X, X, X );
    printf("%d is in memory address %p", X, &X);

    return 0;

And the result something like this:


Post a Comment

Copyright © Welcome