void Decimal_to_Octal()
{
int n,r[10],i;
cout<<"Enter a number to find it's octal equivalent";
cin>>n;
cout<<"The octal equivalent of "<
{
r[i]=n%8;
n=n/8;
}
i--;
for(;i>=0;i--)
cout<
Write a program in c++ that take input in a integer matrix of size 4*4 and find out if the entered matrix is diagonal or not.
If necessary, pad the value with zeroes so the number of bits is an exact multiple of 3. Then divide the binary value into groups of 3 bits. Convert each group to its corresponding octal digit as follows: Bin = Oct 000 = 0 001 = 1 010 = 2 011 = 3 100 = 4 101 = 5 110 = 6 111 = 7 Example 1: 16-bit value: 1011101101100011 3-bit groupings: (00)1 011 101 101 100 011 Octal digits: 1 3 5 4 3 Octal value: 13543 Example 2: 24-bit value: 010111011010010101011010 3-bit groupings: 010 111 011 010 010 101 011 010 Octal digits: 2 7 3 2 2 5 3 2 Octal value: 27322532
I assume you mean is an if the number is an integer multiple of 3i am unfamiliar with C but the theory would be,find if a is integer multiple of 3b=a/3b==round(b).if 1 "yes"else "no"this is an inefficiency way but will get the job done
The most simpliest way is to use a nested loop. However this runs in O(N*N) time. For small arrays, this should be sufficient.
Assuming the number is represented by a decimal integer, initialise a counter to zero, then repeatedly divide the number by 10 and until the number is zero. After each division, examine the remainder. Each time the remainder is zero, increment the counter. If the number is represented by a decimal float, repeatedly multiply by 10 until the value is an integer, then perform the previous algorithm.
Use %o
You can multiply the numerator and the denominator of a fraction by any non-zero integer to get an equivalent fraction.
To find the Excess-3 equivalent of the octal number 1543, first convert each octal digit to its binary equivalent: 1 (001), 5 (101), 4 (100), and 3 (011). Then, convert each binary digit to its decimal form and add 3 to each digit: 1+3=4, 5+3=8, 4+3=7, and 3+3=6. Finally, convert these decimal values back to binary: 4 (100), 8 (1000), 7 (0111), and 6 (0110). Thus, the Excess-3 equivalent of octal 1543 is 100 1000 0111 0110.
Suppose you are given the ratio X/Y.To find an equivalent ration, take ANY positive integer, k. Then (k*X)/(k*Y) is an equivalent ratio.Strictly speaking, k need not be a positive integer: it need not even be a real number. All that is required is that it is not 0.
To find an integer you ask your teacher.
418 is an integer and not a fraction. So division is not going to help.
Multiply the numerator and the denominator by the same integer.
Write a program in c++ that take input in a integer matrix of size 4*4 and find out if the entered matrix is diagonal or not.
0.19 = 19/100 as a fraction. To find other equivalent fractions you simply multiply the numerator and denominator by the same non-zero integer.
To find the equivalent ratio of 12 to 5, you can multiply both numbers by the same non-zero integer. For example, multiplying both by 2 gives you an equivalent ratio of 24 to 10. Similarly, multiplying by 3 would yield 36 to 15. Thus, equivalent ratios can be represented as (12n) to (5n) for any integer n.
I dont freakin know, use a god damned calculator, I'm not Einstein mother fu**er.
Pick any non-zero integer, n. Then A*n and B*n are an equivalent ratio.