Examlex

Solved

On Most Systems,you Don't Get a Chance to Enter the Letter

question 26

Essay

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.


Definitions:

Gerald Ford

Gerald Ford was the 38th President of the United States, serving from 1974 to 1977, best known for his efforts to heal the country post-Watergate scandal.

Political Careers

The progression of individuals in roles and responsibilities within government and public service.

Open-market Operations

The buying and selling of government securities by a central bank to control the money supply and interest rates in the economy.

Friedman Rule

A monetary policy rule proposed by economist Milton Friedman, suggesting that the optimal nominal interest rate is zero to eliminate the opportunity cost of holding money.

Related Questions