Question: on C++. I cant figure this out. Please help. Using the ASCII chart in Appendix B, complete the following program by assigning the char variables

on C++. I cant figure this out. Please help.

Using the ASCII chart in Appendix B, complete the following program by assigning the char variables with your initials. There are 4 different ways you can assign a value.

Post the values you used in each category:

char: P,O

dec: 80,79

oct: ?,?

hex: ?,?

 

Sample Output:

Char: PO
Dec:  PO
Oct:  PO
Hex:  PO

 

// This program demonstrates the close relationship between

// characters and integers.

#include

using namespace std;


 

int main()

{

char first;

char last;


 

first = 'P'; // your initials using Char

last = 'O';

cout << "Char: " << first << last << endl;

first = ; // your initials using Base 10

last = ;

cout << "Dec: " << first << last << endl;

first = ; // your initials using Base 8

last = ;

cout << "Oct: " << first << last << endl;

first = ; // your initials using Base 16

last = ;

cout << "Hex: " << first << last << endl;

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Certainly Based on the ASCII chart in Appendix B here are the values you can use to assign your init... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Algorithms Questions!