Define and use Octal Constants - C Data Type

C examples for Data Type:int

Introduction

An octal value is a number to base 8.

Each octal digit has a value from 0 to 7,

Octal digit uses three bits in binary.

An integer constant that starts with a zero, such as 014, will be interpreted as an octal number.

014 is the octal equivalent of the decimal value 12.

Demo Code

#include <stdio.h> 
  
int main(void) 
{ 
    unsigned long long v = 014;
 
    printf("%d",v);   
    //from  w  w w. jav a 2 s .com
    return 0;
}

Related Tutorials