Ask Question
20 October, 09:22

Declare two variables of type char. assign the letter a to the first char variable named letter1 and t to the second variable named letter2.

+4
Answers (1)
  1. 20 October, 09:44
    0
    Variable is a named location where a value is stored. There are different types of variable, such as there are different types of values (integer, character, etc.).

    To create an integer variable, the syntax is

    int "name of the variable"

    To create a char variable, the syntax is:

    char "name of the variable"

    In our case the variables are letter1 and letter2 and the values that belong to them are a and t, respectively.

    So, the syntax is:

    char letter1;

    char letter2;

    And the assignment statements are:

    letter1='a';

    letter2='t';
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Declare two variables of type char. assign the letter a to the first char variable named letter1 and t to the second variable named letter2. ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers