Ask Question

Declare a char array named line of size 50, and write a statement that reads in the next line of console input into this array. (Assume the line may contain whitespace characters and the total number of the characters in the line is less than 50)

+1
Answers (1)
  1. 16 April, 00:36
    0
    Following are the statement in the C+ + Programming Language.

    //set character data type variable

    char line[50];

    //get character input from the user

    cin. get (line, 50);

    Explanation:

    Following are the description of the statement.

    In the above statement, we set character data type array variable that is 'line' and its index value is '50' that means the following variable not contain more than 50 character elements. In the other line, we get character type input in the following variable 'line' from the user through the get () method.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Declare a char array named line of size 50, and write a statement that reads in the next line of console input into this array. (Assume the ...” 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