This preview shows page 1. Sign up to view the full content.
Unformatted text preview: 3 Lecture 10 Helena Wong / CS2331 Problem Solving and Programming (10-11 Sem A) Lecture Demo Exercises
Question 1. Explicit type conversion for fundamental types
(just like using a conversion constructor / Lecture09.pdf page 7) Syntax: simple-type-name ( expression ) Useful: We can convert fundamental values to the wanted types like:
cout << "Average is : "
<< endl; Your task:
The program on the right attempts to
read a letter and then show the next
char (not the code) in the ASCII table.
However, it gives wrong output. Fix it. char c;
cout << "Input a letter: ";
cin >> c;
cout << "The next letter in ASCII is: " <...
View Full Document
This document was uploaded on 10/15/2013.
- Fall '13