Introduction to Programming with C++
Introduction to Programming with C++
3rd Edition
ISBN: 9780133252811
Author: Y. Daniel Liang
Publisher: Prentice Hall
bartleby

Concept explainers

bartleby

Videos

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

Explanation of Solution

Given: The following code:

int i = '1';

int j = '1' + '2';

int k = 'a';

char c = 90;

cout << i << " " << j << " " << k << " " << c << endl;

To find: The printout of the code mentioned below.

int i = '1';

int j = '1' + '2';

int k = 'a';

char c = 90;

cout << i << " " << j << " " << k << " " << c << endl;

Solution:

In the code given, the variables, i, j, and k will print the ASCII values of the numbers and the alphabets assigned to them.

The variable, i, will get the ASCII value of 1 which is 49.

The variable, j, will add the ASCII value of 1 and 2, thereby making it 99.

The variable, k, will get the ASCII value of ‘a’ which is 97.

The variable, c, is a character variable; hence, it will print the character code of the value of the variable 90 assigned to it, which is z...

Blurred answer
Students have asked these similar questions
Need Java method please. Thank you.
Need Java method please. Thank you.
3. Write two nested loops to generate the following output. (Note: There is one space between each number, and any extra line shown is intentional.) 12 10 8 6 18 15 12 24 20 30 2 3 3 6 48 12 5 10 15 20 6 12 18 24 30

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
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
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY