Answer:
6=110
13=1101
18=10010
27=11011
Explanation:
A decimal number is converted to binary number by constantly dividing the decimal number by 2 till the number becomes zero and then write the remainders in reverse order of obtaining them.Then we will get our binary number.
I will provide you 1 example:-
18/2 = 9 the remainder =0
9/2 = 4 the remainder =1
4/2 = 2 the remainder =0
2/2 = 1 the remainder =0
1/2 = 0 the remainder =1
Writing the remainder in reverse order 10010 hence it is the binary equivalent of 18.
It’s real my easy you can use a calculator or an online converter. Or division
(111001)₂ = (1 × 2⁵) + (1 × 2⁴) + (1 × 2³) + (0 × 2²) + (0 × 2¹) + (1 × 2⁰) = (57)₁₀
(1100000)₂ = (1 × 2⁶) + (1 × 2⁵) + (0 × 2⁴) + (0 × 2³) + (0 × 2²) + (0 × 2¹) + (0 × 2⁰) = (96)₁₀
(1010101)₂ = (1 × 2⁶) + (0 × 2⁵) + (1 × 2⁴) + (0 × 2³) + (1 × 2²) + (0 × 2¹) + (1 × 2⁰) = (85)₁₀
(1001000)₂ = (1 × 2⁶) + (0 × 2⁵) + (0 × 2⁴) + (1 × 2³) + (0 × 2²) + (0 × 2¹) + (0 × 2⁰) = (72)₁₀
Answer:
The code to this question can be given as:
code:
tp = ip;
ip = jp;
jp = tp;
Explanation:
In this question, it is defined that write code for swapping values that swap the pointers, not the values they point to. So in this code, we assume that all the variable and its value is defined. we simply use the swapping rule that is the first value holds in the new variable and second value hold on the first variable and in the last second variable holds the value of the new variable. In this code, the value will be interchanged or swapped.
Options :
A.) s1 < s2
B.) s1 <= s2
C.) s1.compareTo(s2) == −1
D.) s2.compareTo(s1) < 0
E.) s1.compareTo(s2) < 0
Answer: E.) s1.compareTo(s2) < 0
Explanation: Lexicographical ordering simply means the arrangement of strings based on the how the alphabets or letters of the strings appear. It could also be explained as the dictionary ordering principle of words based on the arrangement of the alphabets. In making lexicographical comparison between strings, the compareTo () method may be employed using the format below.
If first string = s1 ; second string = s2
To compare s1 with s2, the format is ;
s1.compareTo(s2) ;
If s1 comes first, that is, before s2, the method returns a negative value, that is a value less than 0 '< 0', which is the case in the question above.
If s2 comes first, that is, before s1, the method returns a positive value, that is a value greater than 0 '> 0'.
If both are s1 and s2 are the same, the output will be 0.