3 char input[50]; /* for operator and number */
4 char choice[3]; /* for the choice i give you, hahahaha */
5 char operator; /* tells me how to calculate */
6 char quit; /* to quit the averager */
8 float result; /* the result of the calculations */
9 int yachoi; /* for ya choice that i gave you, hahahaha */
10 float value; /* the value i have to calculate with */
11 int counter; /* counting the amount of numbers to average */
15 printf ("Welcome to Frank's Calculator.\n");
18 while(1) /* Loop 1 -- ya choice ! */
21 printf ("What do you want to do:\n");
22 printf ("1=Calculate\n");
23 printf ("2=Average an amount of numbers\n");
24 printf ("3=Quit Program\n");
26 printf ("Your choice: ");
28 fgets(choice, sizeof(choice), stdin);
29 sscanf(choice, "%d", &yachoi);
33 printf ("Thanks for using the Frankulator -- see ya!\n");
42 result = 0; /* I don't want the computer to get a number by chance */
44 printf ("The CaLcUlAtOr -- press 'q` to go to main menu!\n");
46 while(1) /* Loop 1.1 -- the calculator */
49 printf ("Result = %f !\n", result);
51 printf ("Enter operator and number: ");
53 fgets(input, sizeof(input), stdin);
54 sscanf(input, "%c %f", &operator, &value);
58 printf ("See ya dude!\n");
76 printf("Illegal you stoopid! ...try again\n");
82 printf ("Sorry, don't know operator...try another!\n");
90 printf ("Welcome to the aVeRaGeR -- press 'q` for main menu!\n");
98 printf ("Enter number %d : ",counter);
100 fgets(input, sizeof(input), stdin);
101 sscanf(input, "%c", &operator);
107 printf ("Stoopido... try anothertime, he!\n");
110 printf ("The average is : %f !\n",result/(counter-1));
114 sscanf(input, "%f", &value);
122 printf ("Come on try again...stoopid!\n");