Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
ZeichenALsDec_HexAusgeben.cpp@0:c2d61f919dad, 2020-04-21 (annotated)
- Committer:
 - jesephin
 - Date:
 - Tue Apr 21 20:09:42 2020 +0000
 - Revision:
 - 0:c2d61f919dad
 
ZeichenAlsDec_HexAusgeben.cpp
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| jesephin | 0:c2d61f919dad | 1 | /*Schreiben Sie ein Konsolenprogramm, das ein Zeichen einliest und dieses Zeichen sowohl | 
| jesephin | 0:c2d61f919dad | 2 | als Zeichen als auch als Dezimal- bzw. Hexadezimalwert ausgibt. | 
| jesephin | 0:c2d61f919dad | 3 | Verwenden Sie sowohl scanf als auch cin für die Eingabe, bei der Ausgabe probieren Sie | 
| jesephin | 0:c2d61f919dad | 4 | cout und printf aus.*/ | 
| jesephin | 0:c2d61f919dad | 5 | |
| jesephin | 0:c2d61f919dad | 6 | |
| jesephin | 0:c2d61f919dad | 7 | #include <iostream> | 
| jesephin | 0:c2d61f919dad | 8 | using namespace std; | 
| jesephin | 0:c2d61f919dad | 9 | int main() | 
| jesephin | 0:c2d61f919dad | 10 | { | 
| jesephin | 0:c2d61f919dad | 11 | char zeichen; | 
| jesephin | 0:c2d61f919dad | 12 | |
| jesephin | 0:c2d61f919dad | 13 | cout << "Geben Sie ein Zeichen ein: "; | 
| jesephin | 0:c2d61f919dad | 14 | cin >> zeichen; | 
| jesephin | 0:c2d61f919dad | 15 | cout << zeichen<< endl; | 
| jesephin | 0:c2d61f919dad | 16 | cout << " Als decimal value ist : " << int(zeichen) << endl | 
| jesephin | 0:c2d61f919dad | 17 | << " Als hex value ist : " << "0x"; | 
| jesephin | 0:c2d61f919dad | 18 | printf( "%x\n",zeichen ); | 
| jesephin | 0:c2d61f919dad | 19 | |
| jesephin | 0:c2d61f919dad | 20 | return 0; | 
| jesephin | 0:c2d61f919dad | 21 | } |