Computer Science, asked by ashakakileti04, 1 year ago

state the number of bytes and bits occupied by a character array of 10 elements

Answers

Answered by Anonymous
53

For different compilers, different number of bytes is occupied for various datatypes. For example in C language, memory space occupied for char (character) datatype is 1 byte or 8 bits and for int (integer) datatype, bytes occupied are 2.

Let’s assume that the compiler here is C.

Hence, for a character array of 10 elements,  

Number of bytes =  10*1 = 10 bytes

Since, 1 byte contains 8 bits,

Number of bits = 10*8 = 80 bits

Answered by Arslankincsem
18

Explanation:

For different compilers, different number of bytes is occupied for various datatypes. For example in C language, memory space occupied for char (character) datatype is 1 byte or 8 bits and for int (integer) datatype, bytes occupied are 2.

Let’s assume that the compiler here is C.

Hence, for a character array of 10 elements,  

Number of bytes =  10*1 = 10 bytes

Since, 1 byte contains 8 bits,

Number of bits = 10*8 = 80 bits

Similar questions