Leading zero specifies octal constant, not decimal : octal « Data Types « C# / C Sharp






Leading zero specifies octal constant, not decimal

 

using System;

public class MainClass{
    public static void Main() {
        int k = 0365;  // Leading zero specifies octal constant, not decimal
        Console.WriteLine(k);
    }
}

   
  








Related examples in the same category

1.To specify an octal constant, begin the specification with 0, followed by a sequence of digits in the range 0 through 7.
2.Not a decimal number; erroneous octal constant