Computer Programming 1 CPP - week3
Computer Programming 1 CPP - week3
#include<iostream>
int main(){
char c = ‘A’;
cout<<”c =”<<c<< “, int(c) =”<<int(c)<<endl;
c = ‘t’;
cout<< “c =”<<c<< “, int(c) =”<<int(c)<<endl;
c = ‘!’;
cout<< “c=”<< “, int(c) =”<<int(c)<<endl;
}
Since character values are used for input and
output, they appear in their character form
instead of their integral form:
End of Week 3