Answer:
a. 6 bits
b. 1
Explanation:
Ans (a)
40 Characters need to be represent by binary coded Zebronian (BCZ) , So You will need 6 bits.
5 bits wold only give you 32 = 2 x 2 x 2 x 2 x 2 unique characters.
So 6 bits would allow you to represent 64 characters.
Ans(b)
BCD = Binrary Coded Decimal is very common in electronics, particularly it displays numerical data.
BCD Encodes each digit of a decimal number into 4 digit binary form.
Each decimal digit is indiviidually converted to oits binary equivalent
For Example : 146 , the decimal degits are replaced by 0001 , 0100 and 0110 respectively
Addition
1 0 = 10 is binary value of 2 2
+1 1 = 11 is binary value of 3 + 3
---------- -----------
1 0 1 5 Ans
Subtraction
1 1= binary value of 3 3
- 1 0 = binary value of 2 - 2
--------- -----------
0 1 1 Ans
#2: Portrait taller than wide & landscape wider than tall
left[0]=a[0];
for(int i=1;i<=n-1;i++)
left[i]=(left[i-1]*a[i])%M;
right[n-1]=a[n-1];
for(int i=n-2;i>=0;i--)
right[i]=(right[i-1]*a[i])%M;
for query q
if(q==0)
return right[1]%M;
if(q==n-1)
return left[n-2]%M;
return (left[q-1]*right[q+1])%M;
Answer:
Ada Lovelace was the first computer programmer
Answer:
import random
randomlist = []
for i in range(0,20):
n = random.randint(-29,30)
if n < 0 :
n = 100
randomlist.append(n)
print(randomlist)
Explanation:
The random module is first imported as it takes care of random. Number generation.
An empty list called randomliay is created to hold the generated random integers.
Using a for loop, we specify the range of random numbers we want.
Inside the for loop ; we attach our generated random integer which will be in the range (-29 to 30) in a variable n
For each n value generated, if the value is less than 0( it is negative, since all the values are integers), replace the value with 100.