Ask Question
15 November, 20:07

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. 15 November, 22:54
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers