Introduction to Programming with C++, 3rd edition
Introduction to Programming with C++, 3rd edition
3rd Edition
ISBN: 9780133377477
Author: Y. Daniel Liang
Publisher: Pearson Academic Computing
bartleby

Concept explainers

Expert Solution & Answer
Book Icon
Chapter 4, Problem 9CP

Explanation of Solution

Given: The following code:

char c = 'A';

int i = c;

float f = 1000.34f;

int j = f;

double d = 1000.34;

int k = d;

int l = 97;

char ch = l;

cout << c << endl;

cout << i << endl;

cout << f << endl;

cout << j << endl;

cout << d << endl;

cout << k << endl;

cout << l << endl;

cout << ch << endl;

To find: The output of the code mentioned below.

char c = 'A';

int i = c;

float f = 1000.34f;

int j = f;

double d = 1000.34;

int k = d;

int l = 97;

char ch = l;

cout << c << endl;

cout << i << endl;

cout << f << endl;

cout << j << endl;

cout << d << endl;

cout << k << endl;

cout << l << endl;

cout << ch << endl;

Solution:

The given code will display the ASCII values or the character codes of their respective variables.

If the variable is of type, int, then it’s ASCII value will be displayed.

If the variable is of type, char, then it’s character code will be displayed.

The output will be:

A

65

1000.34

1000

1000...

Blurred answer
Students have asked these similar questions
hi, I need help to resolve the case, thank you
The following table shows the timestamp and actions by two users. Choose the best option that describes the outcome of the actions. Time JohnSara 10:14 select* from hr.employees; 10:15 Update hr.employees set salary= 100  where employee_id= 206; 10:16 Commit:  Select* from hr.employees; 10:18 Commit: 10:20 Select* from hr.employees;  Commit:   John's query willreturn the same results all three times it is executed as they are run in the same session.   John's queries run at10:16 and10:20 produce the same result, which is different from the one at 10:14   John's query run at 10:16 waits until 10:18 to produce results, waiting for the commit to happen.   John's queries run at 10:14 and 10:16 produce the same result, which is different from the one at 10:20
what's the process used to obtain IP configuration using DHCP in Windows Server.

Chapter 4 Solutions

Introduction to Programming with C++, 3rd edition

Ch. 4 - If the input for a starting character and an...Ch. 4 - If you run Listing 4.4 GuessBirthday.cpp with...Ch. 4 - Which function do you use to test whether a...Ch. 4 - Which function do you use to convert a letter to...Ch. 4 - Prob. 15CPCh. 4 - Prob. 16CPCh. 4 - Prob. 17CPCh. 4 - Prob. 18CPCh. 4 - Write a statement that changes the first character...Ch. 4 - Show the output of the following code:...Ch. 4 - Prob. 21CPCh. 4 - To use stream manipulators, which header file must...Ch. 4 - Show the output of the following statements....Ch. 4 - Show the output of the following statements:...Ch. 4 - Show the output of the following statements;...Ch. 4 - Show the output of the following statements:...Ch. 4 - Prob. 27CPCh. 4 - How do you create an object for reading data from...Ch. 4 - Prob. 29CPCh. 4 - What happens if the file already exists when you...Ch. 4 - (Geometry: area of a pentagon) Write a program...Ch. 4 - (Geometry: great circle distance) The great circle...Ch. 4 - (Geography: estimate areas) Find the GPS locations...Ch. 4 - (Geometry: area of a hexagon) The area of a...Ch. 4 - Prob. 5PECh. 4 - (Random point on a circle) Write a program that...Ch. 4 - Prob. 7PECh. 4 - (Find the character of an ASCII code) Write a...Ch. 4 - Prob. 9PECh. 4 - (Vowel or consonant?) Assume letters...Ch. 4 - Prob. 11PECh. 4 - (Convert letter grade to number) Write a program...Ch. 4 - (Hex to binary) Write a program that prompts the...Ch. 4 - Prob. 14PECh. 4 - (Phone key pads) The international standard...Ch. 4 - Prob. 16PECh. 4 - Prob. 17PECh. 4 - Prob. 18PECh. 4 - (Order three cities) Write a program that prompts...Ch. 4 - Prob. 20PECh. 4 - (Student major and status) Write a program that...Ch. 4 - Prob. 22PECh. 4 - (Check SSN) Write a program that prompts the user...
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning