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 two separate drawers, there are 12 pairs of socks, 9 of which are white, and 7 t-shirts, 5 of which are white. If you randomly select one pair of socks from
Blocks with masses of 3.0 kg , 4.0 kg , and 5.0 kg are lined up in a row on a frictionless table. All three are pushed forward by a 20 N force applied to the 3.
Which expression is equivalent to 5^-6*5^-1
What is the theme for Kruppel Engels
_________ duct carry sperm to urethra
1=x^2 Solve for X. Y=x^2-1
The sum of the ages of two friends ia 15 years Two years ago, the product of their ages in years was 30 write the suitable quadratic equation to solve the probl
Quarry Industries issued $250,000 in bonds last year to fund an expansion. Each of the bonds has a par value of $1,000 and a coupon rate of 3% paid semi-annuall
An article was sold for rupees 920 with a loss of 8%. What was its cost price? provide the formula also.
Verify that a²-b² /a+b = (a-b)​