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 */
#include<stdio.h>

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);
    printf("\n");

    return 0;
}




And the result something like this:


0 comments:

Post a Comment

 
 
Copyright © Welcome