Ask Question
Yesterday, 21:11

How can I write an assignment statement that stores the character 'X' in a variable ch?

+3
Answers (1)
  1. Yesterday, 23:00
    0
    In C+ + we can assign a character to the variable by using the below statement.

    ch='X';

    Explanation:

    The complete program for assigning a character to the variable is given as

    #include

    #include

    using namespace std;

    main ()

    {

    char ch;

    ch = 'X';

    cout<<"output of variable Ch = "<
    getch ();

    }

    In above program Char is the data type used for character type variables. ch = 'X' stores X in ch. Then output will shown through cout.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “How can I write an assignment statement that stores the character 'X' in a variable ch? ...” 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