alexandradumit5105 alexandradumit5105
  • 03-02-2020
  • Computers and Technology
contestada

Assume that c is a char variable has been declared. Write some code that reads in the first character of the next line into c. Assume that the lines of input are under 100 characters long.

Respuesta :

frknkrtrn
frknkrtrn frknkrtrn
  • 04-02-2020

Answer:

cin.ignore(100,'\n') >> c;

Explanation:

In order to read data in C language, cin >> variable_name is used. In the question it is also asked that we should read until the next line, assuming the input is under 100 characters long.

If we use cin.ignore(100, '\n'), this will enable us to read until the next line. It will ignore first 100 character, and stop reading data when it reaches '\n' (in this case stopping criteria is being at the end of the line).

Answer Link

Otras preguntas

20.Mary isn't the only one responsible for this mistake. After all, it takes ____________
5. Find the value of x, if 6: x :: 15:95.​
A rifle bullet with mass 8.00 g and initial horizontal velocity 280 m/s strikes and embeds itself in a block with mass 0.992 kg that rests on a frictionless sur
Fatimah spent 1/4 of her money on 8 cookies and 2 muffins. A muffin cost three times as much as a cookie. She bought some more cookies with 2/7 of her remaining
Who was known as tiger of the north in the Mexican revolution
Handwritten solution required
osteoporosis sometimes causes a spinal deformity called __________.
I need help please !!!
5. Find the value of x, if 6: x :: 15:95.​
A committee of six is selected from ten people, of whom A and B are two. How many committees can be formed: (a) containing both A and B (b) excluding A if B is