Assume that a,b and c are char variables have been declared. Write some code that reads in the first character of the next line into a, the first character of the line after that into b and the first character of the line after that into c. Assume that the lines of input are under 100 characters long.
.
.
Click on the title for the solution
.
.
cin.ignore(99,'\n');
cin.get(a);
cin.ignore(99,'\n');
cin.get(b);
cin.ignore(99,'\n');
cin.get(c);
.
Click on the title for the solution
.
.
This is the answer:
:
cin.ignore(99,'\n');
cin.get(a);
cin.ignore(99,'\n');
cin.get(b);
cin.ignore(99,'\n');
cin.get(c);
Comments
Post a Comment