MrDj200

PS zu KW

Mar 30th, 2016
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.14 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main () {
  4.     start:
  5.     system("cls");
  6.     system("color 0a");
  7.     system("title PS zu KW Rechner");
  8.     printf("####################################\n");
  9.     printf("        PS zu KW Rechner\n");
  10.     printf("####################################\n");
  11.     printf("\n");
  12.     printf("In welche Einheit wollen Sie umrechnen?\n");
  13.     printf("[1] KW in PS\n");
  14.     printf("[2] PS in KW\n");
  15.     printf("[3] Programm beenden\n");
  16.     printf("Auswahl: ");
  17.     fflush(stdin);
  18.  
  19.     float fFrage, fPS, fKW;
  20.     float fUmrechnungPS, fUmrechnungKW, fErgebnis;
  21.     fUmrechnungPS = 1.35962;
  22.     fUmrechnungKW = 0.735499;
  23.  
  24.     scanf("%fl", &fFrage);
  25.  
  26.     if ( fFrage == 1 ) {
  27.         system("cls");
  28.         printf("####################################\n");
  29.         printf("        PS zu KW Rechner\n");
  30.         printf("####################################\n");
  31.         printf("\n");
  32.         fflush(stdin);
  33.  
  34.  
  35.         printf("Bitte KW eingeben: ");
  36.         scanf("%f", &fKW);
  37.         printf("\n");
  38.         fflush(stdin);
  39.         fErgebnis = fKW * fUmrechnungPS;
  40.         printf("Das Ergebnis lautet: %f PS\n", fErgebnis);
  41.         system("pause");
  42.  
  43.     } if ( fFrage == 2 )  {
  44.         system("cls");
  45.         printf("####################################\n");
  46.         printf("        PS zu KW Rechner\n");
  47.         printf("####################################\n");
  48.         printf("\n");
  49.         fflush(stdin);
  50.  
  51.         printf("Bitte PS eingeben: ");
  52.         scanf("%f", &fPS);
  53.         printf("\n");
  54.         fflush(stdin);
  55.         fErgebnis = fPS * fUmrechnungKW;
  56.         printf("Das Ergebnis lautet: %f KW\n", fErgebnis);
  57.         system("pause");
  58.  
  59.     } if ( fFrage == 3 )  {
  60.         system("cls");
  61.         printf("Programm wird beendet!\n\n");
  62.         system("pause");
  63.         return 0;
  64.     } if ( fFrage == 42 ) {
  65.         int intTempVar = 1000;
  66.         do {
  67.             intTempVar = intTempVar - 1;
  68.             system("color 0a");
  69.             system("color 10");
  70.             system("color Ca");
  71.         }while(intTempVar != 0 );
  72.         intTempVar = 0;
  73.     }
  74.  
  75.  
  76.   fflush(stdin);
  77.   fErgebnis = 0;
  78.   goto start;
  79. }
Advertisement
Add Comment
Please, Sign In to add comment