Ask Question
28 April, 20:31

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

+2
Answers (1)
  1. 28 April, 20:38
    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?
Find 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 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