Convert octal to decimal?
Q. how to convert octal to its equivalent decimal,,(i need to convert 666 to decimal) please include steps ... thank you..
Asked by D-devil - Fri Sep 11 23:00:08 2009 - - 7 Answers - 0 Comments
A. People are giving you the answer, and showing you tools (like calculators) you can use to convert, however, I suspect that your question is more along the lines of you have to write a program to convert octal to decimal, or you are going to have to do this by hand on a computer science test, etc. Let's think about the decimal number "10". It comes after "9", of course. Think about the "1" and the "0". The "1", because it is in the "tens" place, means you take it times 10. If you had "201", you'd take the 2 times 100 and add 1. So in octal, "10" is 8. The second place is the "8ths place". If you have "020" (typically in computer programs, if you include a leading zero it is considered to be octal, and if it has a "0x" on the front… [cont.]
Answered by Damocles - Fri Sep 11 23:23:06 2009
Q. how to convert octal to its equivalent decimal,,(i need to convert 666 to decimal) please include steps ... thank you..
Asked by D-devil - Fri Sep 11 23:00:08 2009 - - 7 Answers - 0 Comments
A. People are giving you the answer, and showing you tools (like calculators) you can use to convert, however, I suspect that your question is more along the lines of you have to write a program to convert octal to decimal, or you are going to have to do this by hand on a computer science test, etc. Let's think about the decimal number "10". It comes after "9", of course. Think about the "1" and the "0". The "1", because it is in the "tens" place, means you take it times 10. If you had "201", you'd take the 2 times 100 and add 1. So in octal, "10" is 8. The second place is the "8ths place". If you have "020" (typically in computer programs, if you include a leading zero it is considered to be octal, and if it has a "0x" on the front… [cont.]
Answered by Damocles - Fri Sep 11 23:23:06 2009
Convert Octal to Decimal in C++?
Q. Hello, I'm trying to write a function that can convert an octal number to decimal. This function below worked for converting binary to decimal (when changing the %8 and num / 8 to %10 and num / 10) but it doesn't work this way for the octal system. Hoping I could get some help here. Thanks. int oct2dec ( int num ) { int total = 0; int power = 1; while(num > 0) { total += num % 8 *power; num = num / 8; power = power * 2; } return total; }
Asked by link00seven - Sun Sep 13 21:09:57 2009 - - 2 Answers - 0 Comments
A. int oct2dec ( int num ) { int total = 0,power=1; while(num > 0) { total +=power*(num%10) ; num /= 10; power *= 8; // 2 for binary to decimal } return total; } EDIT: idea behind this is: converting to decimal::: for decimal number system: 423(decimal)=(4*10^2)+(2* 10^1)+(3*10^0) =423(in decimal) for octal number system: 423(octal)=(4*8^2)+(2*8^1 )+(3*8^0)=275 (in decimal) for binary number system: 101(binary)=(1*2^2)+(0*2^ 1)+(1*2^0)=5 (in decimal) from decimal to others int dec2oct ( int num ) { int total = 0,power=1; while(num > 0) { total +=power*(num%8) ; // 2 if decimal to binary num /= 8; // 2 if decimal to binary power *= 10; } return total; }
Answered by TSK - Sun Sep 13 21:35:16 2009
Q. Hello, I'm trying to write a function that can convert an octal number to decimal. This function below worked for converting binary to decimal (when changing the %8 and num / 8 to %10 and num / 10) but it doesn't work this way for the octal system. Hoping I could get some help here. Thanks. int oct2dec ( int num ) { int total = 0; int power = 1; while(num > 0) { total += num % 8 *power; num = num / 8; power = power * 2; } return total; }
Asked by link00seven - Sun Sep 13 21:09:57 2009 - - 2 Answers - 0 Comments
A. int oct2dec ( int num ) { int total = 0,power=1; while(num > 0) { total +=power*(num%10) ; num /= 10; power *= 8; // 2 for binary to decimal } return total; } EDIT: idea behind this is: converting to decimal::: for decimal number system: 423(decimal)=(4*10^2)+(2* 10^1)+(3*10^0) =423(in decimal) for octal number system: 423(octal)=(4*8^2)+(2*8^1 )+(3*8^0)=275 (in decimal) for binary number system: 101(binary)=(1*2^2)+(0*2^ 1)+(1*2^0)=5 (in decimal) from decimal to others int dec2oct ( int num ) { int total = 0,power=1; while(num > 0) { total +=power*(num%8) ; // 2 if decimal to binary num /= 8; // 2 if decimal to binary power *= 10; } return total; }
Answered by TSK - Sun Sep 13 21:35:16 2009
How to convert decimal system to octal system?
Q. Well as I've my igcse ict exam, I really need to know the answer.. thanx n24
Asked by Nahian a.k.a n24 - Sun Oct 11 15:50:39 2009 - - 1 Answers - 0 Comments
A. To convert decimals to octal, divide the original number by the largest possible power of 8 and successively divide the remainders by successively smaller powers of 8 until the power is 1. The octal representation is formed by the quotients, written in the order generated by the algorithm. Here is a detailed explanation with examples and calculators: Here is a good review page:
Answered by iris - Sun Oct 11 19:22:04 2009
Q. Well as I've my igcse ict exam, I really need to know the answer.. thanx n24
Asked by Nahian a.k.a n24 - Sun Oct 11 15:50:39 2009 - - 1 Answers - 0 Comments
A. To convert decimals to octal, divide the original number by the largest possible power of 8 and successively divide the remainders by successively smaller powers of 8 until the power is 1. The octal representation is formed by the quotients, written in the order generated by the algorithm. Here is a detailed explanation with examples and calculators: Here is a good review page:
Answered by iris - Sun Oct 11 19:22:04 2009
how do u convert decimal to octal digits or binary to octal?
Q. how do u convert decimal to octal digits or binary to octal?
Asked by Shax - Fri Aug 21 07:21:55 2009 - - 3 Answers - 0 Comments
A. In both cases, use a calculator. In the latter case: divide the binary number in chunks that consist of 3 bits. Then translate each chuck as follows: 000 = 0 001 = 1 010 = 2 011 = 3 100 = 4 101 = 5 110 = 6 111 = 7 So, the binary number 1 011 101 110 is translated to 001 (pad with two zeros to get a chunk of three bits) = 1 011 = 3 101 = 5 110 = 6 = octal 1356
Answered by jacovkss2 - Fri Aug 21 07:32:47 2009
Q. how do u convert decimal to octal digits or binary to octal?
Asked by Shax - Fri Aug 21 07:21:55 2009 - - 3 Answers - 0 Comments
A. In both cases, use a calculator. In the latter case: divide the binary number in chunks that consist of 3 bits. Then translate each chuck as follows: 000 = 0 001 = 1 010 = 2 011 = 3 100 = 4 101 = 5 110 = 6 111 = 7 So, the binary number 1 011 101 110 is translated to 001 (pad with two zeros to get a chunk of three bits) = 1 011 = 3 101 = 5 110 = 6 = octal 1356
Answered by jacovkss2 - Fri Aug 21 07:32:47 2009
using c programming convert decimal 2 binary,octal,hexadecimal, ?
Q. using c programming convert decimal 2 binary,octal,hexadecimal. write in c programming format.
Asked by vivek - Thu May 21 01:13:54 2009 - - 3 Answers - 0 Comments
A. Hm... Ciaron right! Use format spesifier to printf() for hex %x and octal%o. Now how to convert dec 2 bin: Here my function: char *dec2bin(int bil,char *bin){ int modus=bil%2; bil/=2; *bin++=modus | 0x30; *(bin+1)=0; if(bil)dec2bin(bil,bin); return bin;} HOW TO? char bin[32];//32bit dec2bin(64,bin); strrev(bin); printf("%s",bin);
Answered by cucu-Nya - Sat May 23 04:14:29 2009
Q. using c programming convert decimal 2 binary,octal,hexadecimal. write in c programming format.
Asked by vivek - Thu May 21 01:13:54 2009 - - 3 Answers - 0 Comments
A. Hm... Ciaron right! Use format spesifier to printf() for hex %x and octal%o. Now how to convert dec 2 bin: Here my function: char *dec2bin(int bil,char *bin){ int modus=bil%2; bil/=2; *bin++=modus | 0x30; *(bin+1)=0; if(bil)dec2bin(bil,bin); return bin;} HOW TO? char bin[32];//32bit dec2bin(64,bin); strrev(bin); printf("%s",bin);
Answered by cucu-Nya - Sat May 23 04:14:29 2009
How do you convert OCTAL to BINARY, HEXADECIMAL to DECIMAL, and BINARY to HEXADECIMAL using TURBO C?
Q. Pls help this poor first year! I'm sorry for bothering you guys with my question. Thanks for your time! It means a lot to me! :') From a grateful person
Asked by Kai - Mon Aug 27 22:43:12 2007 - - 4 Answers - 0 Comments
A. Try this functions. They convert ASCII strings. const char dig[] = "0123456789ABCDEF"; void OctToBin(const char *octs, char *bins) { int i = 0; int j; if (octs[0]<'2') j = 2; else if (octs[0]<'4') j = 1; else j = 0; while (octs[i]) { int x = octs[i]-'0'; for (int k=2; k>=0; --k) { if (i*3+k-j>=0) bins[i*3+k-j] = dig[(x%2?1:0)]; x /= 2; } ++i; } bins[i*3-j] = 0; } void HexToDec(const char *hexs, char *decs) { int i = 0; long int x = 0; while (hexs[i]) { if (isdigit(hexs[i])) x = 16*x+hexs[i]-'0'; else x = 16*x+hexs[i]-'A'+10; ++i; } long int y = x; i = 0; do { i++; } while (y /= 10); decs[i] = 0; do { decs[--i] = dig[x%10]; } while (x /= 10); } void BinToHex(const char *bins, char *hexs) { int i = 0; while (bins[i++]); --i; int… [cont.]
Answered by Alexander L - Tue Aug 28 00:18:34 2007
Q. Pls help this poor first year! I'm sorry for bothering you guys with my question. Thanks for your time! It means a lot to me! :') From a grateful person
Asked by Kai - Mon Aug 27 22:43:12 2007 - - 4 Answers - 0 Comments
A. Try this functions. They convert ASCII strings. const char dig[] = "0123456789ABCDEF"; void OctToBin(const char *octs, char *bins) { int i = 0; int j; if (octs[0]<'2') j = 2; else if (octs[0]<'4') j = 1; else j = 0; while (octs[i]) { int x = octs[i]-'0'; for (int k=2; k>=0; --k) { if (i*3+k-j>=0) bins[i*3+k-j] = dig[(x%2?1:0)]; x /= 2; } ++i; } bins[i*3-j] = 0; } void HexToDec(const char *hexs, char *decs) { int i = 0; long int x = 0; while (hexs[i]) { if (isdigit(hexs[i])) x = 16*x+hexs[i]-'0'; else x = 16*x+hexs[i]-'A'+10; ++i; } long int y = x; i = 0; do { i++; } while (y /= 10); decs[i] = 0; do { decs[--i] = dig[x%10]; } while (x /= 10); } void BinToHex(const char *bins, char *hexs) { int i = 0; while (bins[i++]); --i; int… [cont.]
Answered by Alexander L - Tue Aug 28 00:18:34 2007
Convert the following decimal fractions to octal number?
Q. Convert the following decimal fractions to octal number (1)14.46 (2) 16.32 (3) 50.72 (4)11.375 Convert the following decimal fractions to binary number 9.225 (2)13.43
Asked by sikirutaye - Tue Nov 20 08:45:01 2007 - - 2 Answers - 0 Comments
A. Charlie gave a nice website... but use the last block... apparently the upper portion is able to solve only integers... that is why the results are flawed... the lowest one gives the correct values even for numbers with fractional parts... This is the pattern to solve for the fractional part... 0.46 = 0.Abcdefghijkl... Note: 0.46 = 4/10 + 6/10 it must then also be equal to... 0.46 = A/8 + B/8 + C/8 + D/8 + E/8 + F/8 + G/8 + ... how do we choose A, B, C, D, E and so on... we solve in the decimal form... A is the largest portion of 1/8 in 0.46 Note: 0.46 = 3(0.125) + 0.085 ... thus A = 3 0.085 = 5(0.015625) + 0.006875 ... thus B = 5 0.006875 = 3(1/8 ) + 0.001015625 ... thus C = 3 0.001015625 = 4(1/8 ) + 0.000390625 .. D =… [cont.]
Answered by Alam Ko Iyan - Tue Nov 20 09:32:48 2007
Q. Convert the following decimal fractions to octal number (1)14.46 (2) 16.32 (3) 50.72 (4)11.375 Convert the following decimal fractions to binary number 9.225 (2)13.43
Asked by sikirutaye - Tue Nov 20 08:45:01 2007 - - 2 Answers - 0 Comments
A. Charlie gave a nice website... but use the last block... apparently the upper portion is able to solve only integers... that is why the results are flawed... the lowest one gives the correct values even for numbers with fractional parts... This is the pattern to solve for the fractional part... 0.46 = 0.Abcdefghijkl... Note: 0.46 = 4/10 + 6/10 it must then also be equal to... 0.46 = A/8 + B/8 + C/8 + D/8 + E/8 + F/8 + G/8 + ... how do we choose A, B, C, D, E and so on... we solve in the decimal form... A is the largest portion of 1/8 in 0.46 Note: 0.46 = 3(0.125) + 0.085 ... thus A = 3 0.085 = 5(0.015625) + 0.006875 ... thus B = 5 0.006875 = 3(1/8 ) + 0.001015625 ... thus C = 3 0.001015625 = 4(1/8 ) + 0.000390625 .. D =… [cont.]
Answered by Alam Ko Iyan - Tue Nov 20 09:32:48 2007
how Convert Decimal to Octal and hexadecimal?
Q. please help me I really need to understand this my life depends on it...
Asked by fanbadanay - Wed Dec 31 10:36:58 2008 - - 4 Answers - 0 Comments
A. Quite simple - Octal is base 8, hexadecimal, base 16, decimal base 10. This means that in the units column of each base, you have to count to that number before reaching 10. In Octal 10 = 8 decimal, In hexadecimal 10 = 16 decimal. To convert, say 142, to hexadecimal: 142/16 = 8 remainder 14 142 (decimal) is 8E in hexadecimal. ABCDEF are used to denote numbers from 10 to 15 in hexadecimal. Likewise: 142/8 = 17 remainder 6 (to get equivalent of units) 17 divided by 8 = 2 remainder 1 (to get equivalent of hundreds and tens) So 216 is 142 in Octal. (2 x 8 x 8) + (1 x 8) + 6 Or you could look up the table below:
Answered by Andrew W - Wed Dec 31 10:53:22 2008
Q. please help me I really need to understand this my life depends on it...
Asked by fanbadanay - Wed Dec 31 10:36:58 2008 - - 4 Answers - 0 Comments
A. Quite simple - Octal is base 8, hexadecimal, base 16, decimal base 10. This means that in the units column of each base, you have to count to that number before reaching 10. In Octal 10 = 8 decimal, In hexadecimal 10 = 16 decimal. To convert, say 142, to hexadecimal: 142/16 = 8 remainder 14 142 (decimal) is 8E in hexadecimal. ABCDEF are used to denote numbers from 10 to 15 in hexadecimal. Likewise: 142/8 = 17 remainder 6 (to get equivalent of units) 17 divided by 8 = 2 remainder 1 (to get equivalent of hundreds and tens) So 216 is 142 in Octal. (2 x 8 x 8) + (1 x 8) + 6 Or you could look up the table below:
Answered by Andrew W - Wed Dec 31 10:53:22 2008
how do you convert DECIMAL TO BINARY, OCTAL TO DECIMAL and HEXADECIMAL TO OCTAL using turbo c??
Q. how do you convert decimal to binary, octal to decimal and hexadecimal to octal using turbo c??
Asked by Marinea Mae d - Sat Sep 8 02:04:41 2007 - - 1 Answers - 0 Comments
Q. how do you convert decimal to binary, octal to decimal and hexadecimal to octal using turbo c??
Asked by Marinea Mae d - Sat Sep 8 02:04:41 2007 - - 1 Answers - 0 Comments
How to convert decimal to binary, octal and hexadecimal using 80x86 assembler?
Q. How to convert decimal to binary, octal and hexadecimal using 80x86 assembler? Even though you don't present me the whole codes, please give me the logic on how to convert decimal to binary, octal and hexadecimal. I don't want someone will complain why I'm asking and not doing this by myself. Remember that the Yahoo! Answers aims to help others by means of asking. If you don't want to answer, then don't do it. Just simple as that. But for the good people, please help me because I'm still beginner in Assembly Language Programming. Thank you in advance!
Asked by lyssel_smart_pretty - Thu Aug 20 11:02:05 2009 - - 2 Answers - 0 Comments
A. I wanted to start learning Assembly too.. but I'll kinda skip that and just stick to C. Here's something interesting: Have fun with it.
Answered by Lost One - Thu Aug 20 11:15:56 2009
Q. How to convert decimal to binary, octal and hexadecimal using 80x86 assembler? Even though you don't present me the whole codes, please give me the logic on how to convert decimal to binary, octal and hexadecimal. I don't want someone will complain why I'm asking and not doing this by myself. Remember that the Yahoo! Answers aims to help others by means of asking. If you don't want to answer, then don't do it. Just simple as that. But for the good people, please help me because I'm still beginner in Assembly Language Programming. Thank you in advance!
Asked by lyssel_smart_pretty - Thu Aug 20 11:02:05 2009 - - 2 Answers - 0 Comments
A. I wanted to start learning Assembly too.. but I'll kinda skip that and just stick to C. Here's something interesting: Have fun with it.
Answered by Lost One - Thu Aug 20 11:15:56 2009
CaN someone breakdown how to convert binary, hexa, hexa-decimal & octal codes for me?
Q. Im taking a class ... introductions to personal computers, and the very first thing we're learning is how to convert and use the base 2 numbering system... ppl w/ computer/ IT experience.. help me out .. please
Asked by punkin143 - Wed Sep 10 01:30:56 2008 - - 2 Answers - 0 Comments
A. First you need to know how to count in binary, supposing you already know how to count in decimal...everyone should...1, 2, 3, etc. Conversion Code - Chart DECIMAL012345678910 1112131415 HEX0123456789Ab cdef binary0001001000110100010 1011001110001001 10101011100110111011 You can do it...simple stuff!
Answered by JCooper - Wed Sep 10 01:40:03 2008
Q. Im taking a class ... introductions to personal computers, and the very first thing we're learning is how to convert and use the base 2 numbering system... ppl w/ computer/ IT experience.. help me out .. please
Asked by punkin143 - Wed Sep 10 01:30:56 2008 - - 2 Answers - 0 Comments
A. First you need to know how to count in binary, supposing you already know how to count in decimal...everyone should...1, 2, 3, etc. Conversion Code - Chart DECIMAL012345678910 1112131415 HEX0123456789Ab cdef binary0001001000110100010 1011001110001001 10101011100110111011 You can do it...simple stuff!
Answered by JCooper - Wed Sep 10 01:40:03 2008
Write a c++ program to convert octal to decimal and decimal to octal?
Q. Write a c++ program to convert octal to decimal and decimal to octal?
Asked by maka_1979 - Mon Apr 24 23:08:09 2006 - - 2 Answers - 0 Comments
A. since they are all stored as binary all you need to do is display the results as either octal or decimal. //*** //INCLUDE files for :Convert Hex,dec,oct //*** #include #include //for clrscr() & getche()func #include // for exit() function... //*** // Name: Convert Hex,dec,oct // Description:Converts an inputed number to Hex, dec, or oct. The code was mainly written for education purposes. // By: Vagabond // // // Inputs:Inputs are from a main menu screen // // Returns:None // //Assumes:None // //Side Effects:None //This code is copyrighted and has limited warranties. //Please see //for details. //*** //***// // // // Program Name : ConvDec.cpp // // // // Programmer : Vagabond// //: Novice C++ // // // / [cont.]
Answered by David J - Mon Apr 24 23:15:52 2006
Q. Write a c++ program to convert octal to decimal and decimal to octal?
Asked by maka_1979 - Mon Apr 24 23:08:09 2006 - - 2 Answers - 0 Comments
A. since they are all stored as binary all you need to do is display the results as either octal or decimal. //*** //INCLUDE files for :Convert Hex,dec,oct //*** #include
Answered by David J - Mon Apr 24 23:15:52 2006
converting hex and octal( how do you convert the following decimal numbers to the base indicated)?
Q. 1) 2571^10 to octal 2) 128^10 to hex 3) 497^10 to octal 4) 32770^10 to hex having problems please help me solve these...
Asked by Brian M - Wed Sep 24 21:15:15 2008 - - 1 Answers - 0 Comments
A. convert each part of the number: 2571 ... divide by 8 successively (noting the remainders) steps: 2571 / 8 = 321 rem 3 321 / 8 = 40 rem 1 40 / 8 = 5 rem 0 5 / 8 = 0 rem 5 thus 2571 (decimal) = 5013 (octal) similarly, 10 = 8 + 2 thus 10(decimal) = 12(octal) thus 2571^10 (decimal) = 5013^12 (octal) do the same to the other numbers.
Answered by Alam Ko Iyan - Wed Sep 24 21:38:50 2008
Q. 1) 2571^10 to octal 2) 128^10 to hex 3) 497^10 to octal 4) 32770^10 to hex having problems please help me solve these...
Asked by Brian M - Wed Sep 24 21:15:15 2008 - - 1 Answers - 0 Comments
A. convert each part of the number: 2571 ... divide by 8 successively (noting the remainders) steps: 2571 / 8 = 321 rem 3 321 / 8 = 40 rem 1 40 / 8 = 5 rem 0 5 / 8 = 0 rem 5 thus 2571 (decimal) = 5013 (octal) similarly, 10 = 8 + 2 thus 10(decimal) = 12(octal) thus 2571^10 (decimal) = 5013^12 (octal) do the same to the other numbers.
Answered by Alam Ko Iyan - Wed Sep 24 21:38:50 2008
draw a flowchart and write a program to convert two decimal numbers into respective binary & octal conversion?
Q. draw a flowchart and write a program to convert two decimal numbers into respective binary & octal conversion?
Asked by chandrima k - Wed Dec 31 02:49:38 2008 - - 2 Answers - 0 Comments
Q. draw a flowchart and write a program to convert two decimal numbers into respective binary & octal conversion?
Asked by chandrima k - Wed Dec 31 02:49:38 2008 - - 2 Answers - 0 Comments
Any shortcut for converting decimal fractions to binary,octal fractions?
Q. convert decimal fractions to octal fractions and converting decimal fractions to binary fractions
Asked by kim daryl d - Sat Jul 5 02:27:33 2008 - - 1 Answers - 0 Comments
A. Binary and octal are essentially the same thing. For example, 0.0001010011100101110111[ base 2] transforms immediately to octal just break into groups of 3 0.000 001 010 011 100 101 110 111[base 2] 0.01234567[base 8] It is easier, I think to convert to binary than octal. If octal is need, then use the above method. To covert to binary, you can use a technique similar to converting integers. Find largest 1/2^n which is less than the fraction you have, subtract it, and repeat the process. Suppose we want to convert 0.135 to binary: If we look at the negative powers of two, 1/2 is too big (0.5) 1/4 is too big (0.25) 1/8 is OK (0.125) So we have 0.001[base 2] + 1/100 [base 10] (I will omit the base specifications after this.) 1/64 < 1/100 [cont.]
Answered by MathMan TG - Sat Jul 5 17:28:03 2008
Q. convert decimal fractions to octal fractions and converting decimal fractions to binary fractions
Asked by kim daryl d - Sat Jul 5 02:27:33 2008 - - 1 Answers - 0 Comments
A. Binary and octal are essentially the same thing. For example, 0.0001010011100101110111[ base 2] transforms immediately to octal just break into groups of 3 0.000 001 010 011 100 101 110 111[base 2] 0.01234567[base 8] It is easier, I think to convert to binary than octal. If octal is need, then use the above method. To covert to binary, you can use a technique similar to converting integers. Find largest 1/2^n which is less than the fraction you have, subtract it, and repeat the process. Suppose we want to convert 0.135 to binary: If we look at the negative powers of two, 1/2 is too big (0.5) 1/4 is too big (0.25) 1/8 is OK (0.125) So we have 0.001[base 2] + 1/100 [base 10] (I will omit the base specifications after this.) 1/64 < 1/100 [cont.]
Answered by MathMan TG - Sat Jul 5 17:28:03 2008
6. Write a C++ program to convert an octal number to decimal and from decimal back to octal.?
Q. hi Friends Can u Help Me
Asked by Mukesh Bansal - Tue Mar 25 01:34:01 2008 - - 3 Answers - 0 Comments
A. write all the header files urself... iostream.h,math.h i'll write the function void octtodec() {int oct,y,p,sum,x,m,i; cout<<"Enter octal no : "; cin>>oct; for(i=1;m!=0;++i) {m=pow(10,i); y=oct; x=y%m; p=x * pow(10,i-1); sum +=p; y/=10; } cout<<"the decimal value is "<>dec; for(i=0;d!=0;++i) { d=dec; a[i]=d%8; d/=8; count+=1; } cout<<"The octal no is"; for(i=count-1;i>=0;++i) {cout< Answered by Rakshith - Tue Mar 25 01:42:44 2008
Q. hi Friends Can u Help Me
Asked by Mukesh Bansal - Tue Mar 25 01:34:01 2008 - - 3 Answers - 0 Comments
A. write all the header files urself... iostream.h,math.h i'll write the function void octtodec() {int oct,y,p,sum,x,m,i; cout<<"Enter octal no : "; cin>>oct; for(i=1;m!=0;++i) {m=pow(10,i); y=oct; x=y%m; p=x * pow(10,i-1); sum +=p; y/=10; } cout<<"the decimal value is "<
Converting Octal to Decimal in Java?
Q. This is what i have so far. I need to write a program to convert a octal number less than 9 digits long into the decimal form. ex.) user inputs: 7614. how do i take each number of that input and multiply it by the positional values? import java.util.Scanner; public class kylef_Decimal { public static void main ( String args[] ) { int foo; Scanner input = new Scanner( System.in ); do { System.out.print ("Enter up to an 8-digit octal number and I'll "+ "convert it: "); foo = input.nextInt(); System.out.printf ("%d:%d\n", foo, convert(foo)); } while ((foo<0) || (foo>777)); } public static int convert(int octalNumber) { ??? return decimal; } }
Asked by unknown - Tue Nov 3 19:32:39 2009 - - 1 Answers - 0 Comments
Q. This is what i have so far. I need to write a program to convert a octal number less than 9 digits long into the decimal form. ex.) user inputs: 7614. how do i take each number of that input and multiply it by the positional values? import java.util.Scanner; public class kylef_Decimal { public static void main ( String args[] ) { int foo; Scanner input = new Scanner( System.in ); do { System.out.print ("Enter up to an 8-digit octal number and I'll "+ "convert it: "); foo = input.nextInt(); System.out.printf ("%d:%d\n", foo, convert(foo)); } while ((foo<0) || (foo>777)); } public static int convert(int octalNumber) { ??? return decimal; } }
Asked by unknown - Tue Nov 3 19:32:39 2009 - - 1 Answers - 0 Comments
in c++: convert decimal to hexa-decimal and also octal. any formula?
Q. in c++: convert decimal to hexa-decimal and also octal. any formula?
Asked by anonymous05 - Wed Oct 10 01:34:55 2007 - - 4 Answers - 0 Comments
A. C++ will do the work for you... #include using namespace std; int main(void) { int mynum; cout << "\nEnter a number: "; cin >> mynum; cout.unsetf(ios::dec); cout.setf(ios::hex | ios::showbase); cout << "In hex: " << mynum; cout.unsetf(ios::hex); cout.setf(ios::oct); cout << "\nIn Octal: " << mynum; cout.unsetf(ios::oct | ios::showbase); cout.setf(ios::dec); return 0; }
Answered by thomasjcollins - Wed Oct 10 04:50:48 2007
Q. in c++: convert decimal to hexa-decimal and also octal. any formula?
Asked by anonymous05 - Wed Oct 10 01:34:55 2007 - - 4 Answers - 0 Comments
A. C++ will do the work for you... #include
Answered by thomasjcollins - Wed Oct 10 04:50:48 2007
How to convert Decimal to Hexadecimal in C programming?
Q. these is our final project that convert Decimal to Binary, Octal and Hexadecimal...i'm done with the two but confused in HexaT_T i have here code that convert Binary to Octal..im confused on how to convert it to Hexadecimal...here is the code i used in Converting Octal: #include int main() { int i=0,n,j,b[100]; printf("\n\n\n\t\tEnter Decimal Number: "); scanf("%d",&n); while(n>0) { b[i]=n%8; n=n/8; i++; } printf("\n\n\t\tOctal is: "); j=i-1; for(i=j;j>=0;j--) { printf("%d",b[j]); } return 0; } can someoen help me edit my code pls for hexa??
Asked by daisy - Wed Oct 7 00:56:31 2009 - - 2 Answers - 0 Comments
A. For Data M, the problem is for the asker to write the routine. It's not to use the printf formatting. There are two main changes to make. You change your base in the division loop while(n>0) { b[i]=n%16; n=n/16; i++; } For any base 10 or less, that's it. For bases more than 10, you have to adjust your printing to use extra symbols. char digits[] = "0123456789ABCDEF"; for(i=j;j>=0;j--) { printf("%c",digits[b[j]]) ; } You can extend this up to base 36 (10 numerals + 26 letters).
Answered by DogmaBites - Fri Oct 9 01:06:35 2009
Q. these is our final project that convert Decimal to Binary, Octal and Hexadecimal...i'm done with the two but confused in HexaT_T i have here code that convert Binary to Octal..im confused on how to convert it to Hexadecimal...here is the code i used in Converting Octal: #include
Asked by daisy - Wed Oct 7 00:56:31 2009 - - 2 Answers - 0 Comments
A. For Data M, the problem is for the asker to write the routine. It's not to use the printf formatting. There are two main changes to make. You change your base in the division loop while(n>0) { b[i]=n%16; n=n/16; i++; } For any base 10 or less, that's it. For bases more than 10, you have to adjust your printing to use extra symbols. char digits[] = "0123456789ABCDEF"; for(i=j;j>=0;j--) { printf("%c",digits[b[j]]) ; } You can extend this up to base 36 (10 numerals + 26 letters).
Answered by DogmaBites - Fri Oct 9 01:06:35 2009
C++ converting decimal to octal/hex?
Q. I have to make a program that converts decimal to octal and hex. I think i pretty much have it done for the octal, but im having a little trouble displaying the results. here's my code: #include using namespace std; int main() { int d[10]; long x[10]; unsigned long n; cout<<"Enter a decimal number"<>n; x[0]=n/8; d[0]=x[0]%8; x[1]=x[0]/8; d[1]=x[1]%8; x[2]=x[1]/8; d[2]=x[2]%8; x[3]=x[2]/8; d[3]=x[3]%8; x[4]=x[3]/8; d[4]=x[4]%8; x[5]=x[4]/8; d[5]=x[5]%8; x[6]=x[5]/8; d[6]=x[6]%8; x[7]=x[6]/8; d[7]=x[7]%8; x[8]=x[7]/8; d[8]=x[8]%8; x[9]=x[8]/8; d[9]=x[9]%8; x[10]=x[9]/8; d[10]=x[10]%8; cout<<"Octal equivalent: "<[cont.]
Asked by xtreme1131 - Sun Sep 20 21:03:34 2009 - - 1 Answers - 0 Comments
A. cout<<"Octal equivalent: "< Answered by unknown - Sun Sep 20 21:36:57 2009
Q. I have to make a program that converts decimal to octal and hex. I think i pretty much have it done for the octal, but im having a little trouble displaying the results. here's my code: #include
Asked by xtreme1131 - Sun Sep 20 21:03:34 2009 - - 1 Answers - 0 Comments
A. cout<<"Octal equivalent: "<
From Yahoo Answer Search: 'convert octal to decimal'
Sat Nov 21 23:28:08 2009 [ refresh local cache ]
[Hide]▼
JavaScript Data Types and Variables - Learning Javascript - O ...
unknown
Sun, 23 Aug 2009 00:45:55 GM
What's interesting with both the . octal. and . decimal. representations is that if you . convert. either to a string using the String function (covered earlier), the scripting engine first converts the number to its base-10 (. decimal. ) ...
unknown
Sun, 23 Aug 2009 00:45:55 GM
What's interesting with both the . octal. and . decimal. representations is that if you . convert. either to a string using the String function (covered earlier), the scripting engine first converts the number to its base-10 (. decimal. ) ...
[Hide]▲
