Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Suppose that age is an int variable, ch is a char variable, and name is a string variable. What are the values of age and
- Suppose that age is an int variable, ch is a char variable, and name is a string variable. What are the values of age and name after the following input statements execute:
cin>>age;
cin.get(ch);
getline(cin, name);
if the input is:
age name
- 23 Lance Grant; _______ _______
- 23
Lance Grant _______ _______
- True or False
- To use the manipulators setprecision, setw, and setfill, the program must include the header file iostream.
- The manipulator setw formats the output of an expression in a specific number of columns; the default output is right-justified.
- cout is correct on c++ programming syntax.
- The function clear is used to skip certain input in a line.
- What will be displayed on the screen from the following statements?
#include
#include
using namespace std;
int main()
{
int x = 15; //Line 1
int y = 7634; //Line 2
cout
cout
cout
return 0;
}
Display:
- Consider the declaration:
char ch1, ch2;
and the input:
Hello there. My name is Micky.
- Consider the following statements, after executing them, the result for ch1 is_______, for ch2 is _______
cin>>ch1;
cin.ignore(100, .);
cin>>ch2;
- Consider the following statements, after executing them, the result for ch1 is_______, for ch2 is _______
cin>>ch1;
cin.ignore(10, *);
cin>>ch2;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started