Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main () {
- start:
- system("cls");
- system("color 0a");
- system("title PS zu KW Rechner");
- printf("####################################\n");
- printf(" PS zu KW Rechner\n");
- printf("####################################\n");
- printf("\n");
- printf("In welche Einheit wollen Sie umrechnen?\n");
- printf("[1] KW in PS\n");
- printf("[2] PS in KW\n");
- printf("[3] Programm beenden\n");
- printf("Auswahl: ");
- fflush(stdin);
- float fFrage, fPS, fKW;
- float fUmrechnungPS, fUmrechnungKW, fErgebnis;
- fUmrechnungPS = 1.35962;
- fUmrechnungKW = 0.735499;
- scanf("%fl", &fFrage);
- if ( fFrage == 1 ) {
- system("cls");
- printf("####################################\n");
- printf(" PS zu KW Rechner\n");
- printf("####################################\n");
- printf("\n");
- fflush(stdin);
- printf("Bitte KW eingeben: ");
- scanf("%f", &fKW);
- printf("\n");
- fflush(stdin);
- fErgebnis = fKW * fUmrechnungPS;
- printf("Das Ergebnis lautet: %f PS\n", fErgebnis);
- system("pause");
- } if ( fFrage == 2 ) {
- system("cls");
- printf("####################################\n");
- printf(" PS zu KW Rechner\n");
- printf("####################################\n");
- printf("\n");
- fflush(stdin);
- printf("Bitte PS eingeben: ");
- scanf("%f", &fPS);
- printf("\n");
- fflush(stdin);
- fErgebnis = fPS * fUmrechnungKW;
- printf("Das Ergebnis lautet: %f KW\n", fErgebnis);
- system("pause");
- } if ( fFrage == 3 ) {
- system("cls");
- printf("Programm wird beendet!\n\n");
- system("pause");
- return 0;
- } if ( fFrage == 42 ) {
- int intTempVar = 1000;
- do {
- intTempVar = intTempVar - 1;
- system("color 0a");
- system("color 10");
- system("color Ca");
- }while(intTempVar != 0 );
- intTempVar = 0;
- }
- fflush(stdin);
- fErgebnis = 0;
- goto start;
- }
Advertisement
Add Comment
Please, Sign In to add comment