In: Computer Science
A certain programming language allows only two-character variable names. The first character must be a letter (upper or lower case) and the second character can be a letter (upper or lower case) or a digit. How many possible variable names are there?
So First Thing given is, it will be only two character variable name
_ _
So At the first place, We can have one from Either Upper case letters or lower case letters
So there are 26 Upper case letters and 26 Lower case letters,
Since we have to choose one from Upper case letters OR lower case letters, So for OR we use +
Hence 26 + 26 = 52
So for first place we have 52 possibilities, we can have any one letter from these 52 letters
So there are 52 ways for first place.
For second place, We can have one from either 26 upper case letters, or from 26 lower case letters, or from any digit 0-9 i.e 10 choices
Total 26 + 26 + 10= 62
So 62 ways for second digit
Now Final two character variable name will be created by
(Choosing one letter from 52 letters- 26 Upper case OR 26 Lower Case ) AND ( Choosing one letter from 26 Upper case OR 26 Lower Case or 10 digits (0-9)
=( 26 + 26 ) x (26 + 26 + 10)
= 52 x 62
Hence total variable names possible are
52 * 62 = 3224 Variable Names are possible.
Answer = 3224
You can also refer to the same handwritten explanation given below: