On most systems,you don't get a chance to enter the letter when the code given below is run.Write two different code fragments that repair the problem.
cout << "Enter a number:\n";
int number;
cin >> number;
cout << "Enter a letter;\n";
char symbol;
cin.get(symbol);
cout << number << " " << symbol << endl;
Dialog: (Computer output is bolded. )
Enter a number:
21
Now enter a letter:
21
On my system,like many systems,one doesn't get a chance to type the letter.
Correct Answer:
Verified
using namespac...
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q24: Given the following definition and initialization.Write a
Q25: Give the output the following code fragment
Q26: What is a simple way to convert
Q27: Write a C++ program fragment that will
Q28: Write a complete program with necessary #include
Q30: What is the longest C-string that can
Q31: Write a line of code that declares
Q32: Does this code have a problem?
char strVar[]
Q33: Write a short C++ code fragment that
Q34: Reimplement the function strlen.Call your function strLen.The
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents