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

In the figure, a∥b and m∠6 = 146°. What is the m∠2 ? Enter your answer in the box.
can someone please help me with this?? i don’t know how to do it
Joey earns 7.65 per hr at his part-time job. He received a 20% raise. How much will Joey now earn for working 40 hrs
Which inequality and solution represent keeping the area of a triangle under 36 square feet if the height is twice the length of base b
Kinda struggling need help find the answer X^2+6x-72=0
Any literature student?? I need help
How can you tell were an ocean begins and ends?
Abie makes $39,000 a year, and spends about $250 each month on entertainment. What fraction of her annual income is spent on entertainment?
i need help plz pt.2​
A 90° clockwise rotation around the origin is represented by the rule (x, y) → (y, -x). Which statement about perpendicular lines is true?