Didn't Understand to logic of calculation of this program.?
-
when 1 is given as input following program shows b as output why is that so I know that 1 given to char is manipulated differently but how it's being manipulated please explain. #include #include using namespace std; int main() { char ch; cout<<"enter ch "; cin>>ch; ch=ch*2; cout<
-
when 1 is given as input following program shows b as output why is that so I know that 1 given to char is manipulated differently but how it's being manipulated please explain. #include #include using namespace std; int main() { char ch; cout<<"enter ch "; cin>>ch; ch=ch*2; cout<
-
when 1 is given as input following program shows b as output why is that so I know that 1 given to char is manipulated differently but how it's being manipulated please explain. #include #include using namespace std; int main() { char ch; cout<<"enter ch "; cin>>ch; ch=ch*2; cout<
Actually, the printed value depends on how the character values (value of ch) is interpreted as a character. For instance, when using Windows console the following mapping (typically) is used: http://en.wikipedia.org/wiki/Code_page_850[^] EDIT: That table only contains the top half (symbol half) of the story. For the lower part, refer to any ASCII documentation, for instance: http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters[^]