using System;
class Demo {
public static void Main() {
int decVal, quot, i = 1, j;
int[] octalVal = new int[80];
decVal = 40;
quot = decVal;
Console.WriteLine("Decimal Number:{0}",decVal);
while (quot!= 0) {
octalVal[i++] = quot % 8;
quot = quot / 8;
}
Console.Write("Octal Number: ");
for (j = i - 1; j > 0; j--)
Console.Write(octalVal[j]);
Console.Read();
}
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/265919.html