บางครั้งเราอาจเห็นตัวอักษรที่เป็นตัวเลข ซึ่งนำหน้าด้วย 0 ซึ่งบ่งชี้ว่าตัวเลขนั้นเป็นเลขฐานแปด ดังนั้นเลขฐานแปดจึงมี 0 ที่จุดเริ่มต้น เช่น ถ้าเลขฐานแปดคือ 25 เราก็จะต้องเขียน 025
ตัวอย่าง
#include <stdio.h>
int main() {
int a = 025;
int b = 063;
printf("Decimal of 25(Octal) is %d\n", a);
printf("Decimal of 63(Octal) is %d\n", b);
} ผลลัพธ์
Decimal of 25(Octal) is 21 Decimal of 63(Octal) is 51