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

Look at the photo pick A B C D either one explanation not needed thank you! <3 [13]
Which is the better buy: 14 pieces of candy for $5.49 or 35 pieces of candy for $12.24?
I can talk to you! How about we talk through the you know where people comment and say stuff about the question1
Which is an equation for the parabola that has vertex (-4,3) and passes through the point (-1,-15)?
Mr. alvarez studied the soap products on the store shelf. he looked for products with a familiar logo. this is an example of which of the following? choose the
I WILL MARK BRAINLEST!!! FOR YOU CAN ANSWER THESE TWO
Kai marked up the new Kobe Grinch by 35% .She sole them for $168.75 . What was the original price
Evaluate m – n if m = –16 and n = 28
Many people from South America migrate to the north in hopes of crossing into the United States. Which of the following is a likely factors for this population
What is the following quotient?