Prints 100 in decimal, octal, and hex - C Data Type

C examples for Data Type:int

Description

Prints 100 in decimal, octal, and hex

Demo Code

#include <stdio.h>
int main(void)
{
    int x = 100;/*from w  ww. j av a 2s.c  om*/
    
    printf("dec = %d; octal = %o; hex = %x\n", x, x, x);
    printf("dec = %d; octal = %#o; hex = %#x\n", x, x, x);
    
    return 0;
}

Result


Related Tutorials