Computer Science, asked by SPIDEY9330, 1 year ago

a language has 28 different letters in total. each word in the language is composed of maximum 7 letters. you want to create a data-type to store a word of this language. you decide to store the word as an array of letters. how many bits will you assign to the data-type to be able to store all kinds of words of the language.

Answers

Answered by nmalavikamohan
117
In binary, there are only two possibilities- zero and one. 
Thus, looking at the powers of 2, we realize that 32 is the closest exponential result of 2 to 28, where 2^5 = 32.
Hence, to cover all the possibilities, we need 5 bits at the least.
But there are seven letters. Thus, the number of bits we require is 7 * 5 = 35 bits 
Answered by DeVasu
8
That datatype that will be used for storing the word of this language is:
char word[8];

And I will assign 64 bits or 8 bytes to the data type

Similar questions