Paste
Pasted as C by Tim Hartmann ( 14 years ago )
/*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("pause");
system("cls");
}
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("pause");
system("cls");
}
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("pause");
system("cls");
}
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("pause");
system("cls");
}
if (wahl > 4) {
printf("\n\nung\x81ltige Eingabe!\n\n");
system("pause");
system("cls");
}
if (Abfrage== "exit"){
exit(0);
}
}
return 0;
}
/*Copyright © bei TimHartmann*/
Revise this Paste