Ask 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.

+5
Answers (1)
  1. 3 June, 16:16
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers