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)

Respuesta :

Limosa

Answer:

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.
ACCESS MORE