/*Copyright © bei TimHartmann*/

#include <stdlib.h>
#include <stdio.h>
#include <string.h>


main ()
{
    int i;
    for (i = 0; i < 10; i++)
  {    
    float x,y;
    int wahl;
    char Abfrage [20];
    printf("real calc (c) by TimHartmann!");
    printf("\n\nwas willst du tun?");
    printf("\n\n 1 addieren (+)");
    printf("\n 2 subtrahieren (-)");
    printf("\n 3 Multiplizieren (x)");
    printf("\n 4 Dividieren (/)");
    printf("\n\ntriff deine Wahl jetzt!: \n\n");
    
    scanf("%i",&wahl;);
    
    if (wahl == 1){
             printf("\ngib X ein: ");
             scanf("\n%f",&x);
             printf("\n%.0f + " , x);
             scanf("%f",&y);
             
             printf("\n\n%f + %f = %f\n\n\a\a" , x,y,x+y);
             
             system&#40;"pause"&#41;;
             system&#40;"cls"&#41;;
             }
    
    if (wahl == 2) {
             printf("\ngib X ein: ");
             scanf("%f",&x);
             printf("\n%.0f - " , x);
             scanf("%f",&y);
             
             printf("\n\n%f - %f = %f\n\n\a\a" , x,y,x-y);

             system&#40;"pause"&#41;;
             system&#40;"cls"&#41;;
             }
             
    if (wahl == 3){
             printf("\ngib X ein: ");
             scanf("%f",&x);
             printf("\n%.0f x " , x);
             scanf("%f",&y);
             
             printf("\n\n%f x %f = %f\n\n\a\a" , x,y,x*y);
             
             system&#40;"pause"&#41;;
             system&#40;"cls"&#41;;
             }
    
    if (wahl == 4) {
             printf("\ngib X ein: ");
             scanf("%f",&x);
             printf("\n%.0f / " , x);
             scanf("%f",&y);
             
             printf("\n\n%f / %f = %f\n\n\a\a" , x,y,x/y);

             system&#40;"pause"&#41;;
             system&#40;"cls"&#41;;
             }
    if (wahl > 4) {
             printf("\n\nung\x81ltige Eingabe!\n\n");
             system&#40;"pause"&#41;;
             system&#40;"cls"&#41;;
             }
    if (Abfrage== "exit"){       
             exit(0);
             }
  }
  return 0;

}
    
/*Copyright © bei TimHartmann*/

Add a code snippet to your website: www.paste.org