Ah, good call laserlight. Come to think of it, case switch is just a specialized form of an if statement. Utilizing arrays by element number would control the flow of the code without using control statements.
What kind of task is being performed depending on the selection in your case? With a minimal knowledge of arrays, and not knowing functions, you can still store things like strings, numbers, and other pieces of data in the elements of the array, and then calling the element of an array that your user has input into the prompt (you can also use command line arguments if you are familiar with these.)
For instance, you could declare a new array of integers:
Code:
#include <stdio.h>
int main(void)
{
int numbersToAdd[3];
int number1,number2,garbage;
numbersToAdd[0] = 25;
numbersToAdd[1] = 30;
numbersToAdd[2] = 50;
printf("The numbers available for computation are: \n");
printf("0 - %d\n", numbersToAdd[0]);
printf("1 - %d\n", numbersToAdd[1]);
printf("2 - %d\n", numbersToAdd[2]);
printf("Please make your first selection by typing 0, 1, or 2 and then hitting enter.\n");
scanf("%d",&number1);
printf("Please make your second selection.\n");
scanf("%d",&number2);
printf("%d\n",numbersToAdd[number1]+numbersToAdd[number2]);
scanf("%d",&garbage);
return 0;
}